<style lang="less">
  @import "./app-summary.less";
</style>
<template>
    <div>
        <Row>
        
            <Row>
              <el-col :span="23" class="toolbar toolMarginTop" id="serachId">
              <el-form :inline="true" :model="filters">
                <el-button plain @click="appAdd"  size="small" style="float:left;">应用更新审核</el-button>
                <el-form-item style="float:right">
                  <el-button type="primary" size="small" v-on:click="getList">查询</el-button>
                </el-form-item>
                <!-- <el-form-item style="float:right">
                  <el-input v-model="filters.marketName" placeholder="市场名称"></el-input>
                </el-form-item> -->
                <!-- <el-form-item style="float:right">
                  <el-input v-model="filters.appCode" placeholder="应用编码"></el-input>
                </el-form-item> -->
                <el-form-item style="float:right">
                  <el-input v-model="filters.appName" size="small" placeholder="请输入应用名称" @keyup.enter.native="searchEnterFun"></el-input>
                </el-form-item>
              </el-form>
              </el-col>
            </Row>
  
            <el-row class="tac titleLineSymbolTwo">
            <el-col :span="4">
                <el-tree @check-change="toGetList" node-key="marketName" ref="tree" :load="loadData" :props="defaultProps"   lazy  show-checkbox></el-tree>
            </el-col>
            <el-col :span="19" >
                <el-table :data="tableData" style="width: 100%"  >
                  <!-- <el-table-column  width="20">
			            </el-table-column> -->
                  <el-table-column type="index" label="序号" >
                  </el-table-column>
                  <el-table-column prop="appName"  label="应用名称">
                  </el-table-column>
                  <!-- <el-table-column prop="appCode" label="应用编码">
                  </el-table-column> -->
                  <!-- <el-table-column prop="market.marketName" label="市场">
                  </el-table-column> -->
                  <el-table-column prop="applicationType.className" label="应用分类">
                  </el-table-column>
                  <!-- <el-table-column prop="appSource" label="应用来源">
                  </el-table-column> -->
                  <!-- <el-table-column prop="developer" label="开发商">
                  </el-table-column> -->
                  <el-table-column prop="userName" label="创建人">
                  </el-table-column>
                  <el-table-column prop="createDate" label="创建时间" width="155" :formatter="formatCreateDate">
                  </el-table-column>
                  <el-table-column prop="updateDate" label="更新时间" width="155" :formatter="formatUpdateDate">
                  </el-table-column>
                  <el-table-column fixed="right" label="操作" min-width="100">
                  <template slot-scope="scope">
                  <el-button @click="appEdit(scope.$index, scope.row)" type="text" size="small">编辑</el-button>
                  <el-button @click="versionEdit(scope.$index, scope.row)" type="text" size="small">版本信息</el-button>
                  <el-button  v-if="scope.row.publishFlag === 1" type="text" size="small" @click="toPublishApp(scope.$index, scope.row)">已发布</el-button><!-- 发布了其中一种版本之后，还可以发布其它版本 -->
                  <el-button  v-else type="text" size="small" @click="toPublishApp(scope.$index, scope.row)">发布应用</el-button>
                  <el-button  v-if="false" type="text" @click="toAuthorize(scope.$index, scope.row)" size="small">部门授权</el-button>
                  <!-- <el-button   type="text" @click="toAuthDept(scope.$index, scope.row)" size="small">部门授权</el-button> -->
                  </template>
                  </el-table-column>
             </el-table>
            </el-col>
            <el-col :span="23" class="toolbar marginTop10px">
              <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentPageChange"
                    :current-page="pageNum" :page-size="pageSize" :total="total">
              </el-pagination>
            </el-col>
            </el-row>
            <!-- <el-row type="flex" class="row-bg" justify="end">
              <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentPageChange"
                    :current-page="pageNum" :page-size="pageSize" :total="total">
              </el-pagination>
            </el-row> -->
          <!-- 组件-->
          <el-dialog title="应用授权" :visible.sync="authorizedialogVisible" :modal-append-to-body="false">
            <!-- <authorize v-bind:obj="rowAppObj"></authorize> -->
            <el-row class="tac">
            <el-col>
                <el-form >
                <el-table :data="deptTableData" highlight-current-row v-loading="deptListLoading" style="width: 100%"  >
                    <el-table-column prop="organization.name"  label="单位名称">
                    </el-table-column>
                    <el-table-column prop="organization.address" label="办公地址">
                    </el-table-column>
                    <!-- <el-table-column prop="aa" label="AA">
                    </el-table-column> -->
                    <el-table-column fixed="right" label="操作" width="120">
                    <template slot-scope="scopes">
                        <!-- <p>姓名:{{scope.row.aa}}</p> -->
                            <el-button  v-show="!scopes.row.isAuth" @click="Click(scopes.row)" type="text" size="small">授权</el-button>
                           <el-button v-show="scopes.row.isAuth" @click="Click(scopes.row)"  type="text" size="small">取消授权</el-button>
                    </template>
                    </el-table-column>
                </el-table>
                </el-form>
            </el-col>
            <el-col :span="24" class="toolbar">
                <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentPageChange"
                                :current-page="deptPageNum" :page-size="pageSize" :total="deptTotal">
                </el-pagination>
            </el-col>
            </el-row>
            <span slot="footer" class="dialog-footer">
            <el-button @click="authorizedialogVisible = false">关 闭</el-button>
            </span>
          </el-dialog>
          <!-- 组件-->
          <!-- <el-dialog title="部门授权" :visible.sync="authDeptDialogVisible" :modal-append-to-body="false">
            <authDept v-bind:obj="rowAppObj"></authDept>
            <span slot="footer" class="dialog-footer">
            <el-button @click="authDeptDialogVisible = false">关 闭</el-button>
            </span>
          </el-dialog> -->

           <el-dialog title="完善资料" :visible.sync="editdialogVisible" :modal-append-to-body="false">
                  <el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
                  <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick" value="first">
                    <el-tab-pane label="基础信息" name="first">
                      <el-form-item label="应用编码" prop="appCode" >
                        <el-input v-model="editForm.appCode"  placeholder="应用编码"></el-input>
                      </el-form-item>
                      <el-form-item label="应用名称" prop="appName">
                        <el-input v-model="editForm.appName"  placeholder="应用名称"></el-input>
                      </el-form-item>
                      <el-form-item label="应用图标" prop="logoImage">
                      <template>
                      <div>
                        <el-upload
                                :data="paramData"
                                class="upload-demo"
                                ref="upload"
                                :action="uploadUrl"
                                :on-remove="handleRemove"
                                :before-remove="beforeRemove"
                                :file-list="fileList"
                                :limit="1"
                                :on-exceed="handleExceed"
                                :auto-upload="false"
                                :on-success="uploadSuccess"
                                v-model="editForm.logoImage">
                            <el-button slot="trigger" size="small" type="primary">选取图片</el-button>
                            <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
                        <el-input v-model="editForm.logoImage"  placeholder="应用图标" disabled></el-input>
                        </el-upload>
                      </div>
                      </template>
                      </el-form-item>
                      <!-- <el-form-item label="应用图标" prop="logoImage">
                      </el-form-item> -->
                      <el-form-item label="市   场 " prop="appMarket">
                        <el-select v-model="editForm.market.marketName" placeholder="请选择" :disabled="true">
                          <el-option  v-for="item in market" :key="item.marketCode" :value="item.marketCode" :label="item.marketName"></el-option>
                        </el-select>
                      </el-form-item>
                      <el-form-item label="应用分类"  prop="appType">
                        <el-select v-model="editForm.applicationType.className"  placeholder="请选择">
                        <el-option v-for="item in clazz" :key="item.classCode" :value="item.classCode" :label="item.className"></el-option>
                        </el-select>
                      </el-form-item>
                      <el-form-item label="供应商">
                        <el-select v-model="editForm.developer" placeholder="请选择">
                          <el-option  v-for="item in supplierData" :key="item.supplierCode" :value="item.supplierCode" :label="item.supplierName"></el-option>
                        </el-select>
                      </el-form-item>
                      <el-form-item label="是否推荐"  prop="appType" v-if="false">
                        <el-select v-model="editForm.recommend" placeholder="请选择">
                          <el-option label="非默认推荐" value="0"></el-option>
                          <el-option label="默认推荐" value="1"></el-option>
                          <el-option label="手工推荐" value="2"></el-option>
                        </el-select>
                      </el-form-item >
                      <el-form-item label="排序">
                        <el-input v-model="editForm.sort" placeholder="排序"></el-input>
                      </el-form-item>
                      <el-form-item label="应用介绍">
                        <el-input   type="textarea" v-model="editForm.remark" placeholder="应用介绍"></el-input>
                      </el-form-item>
                    </el-tab-pane>
                    <el-tab-pane label="扩展信息" name="second">
                      <el-form :model="extendForm" label-width="130px" :rules="extendFormRules" ref="extendForm">
                        <!-- <el-form-item label="适用终端">
                          <template>
                            <el-checkbox-group v-model="checkedSystems1" :min="1" :max="2">
                              <el-checkbox v-for="system in systems" :label="system" :key="system">{{system}}</el-checkbox>
                            </el-checkbox-group>
                          </template>
                        </el-form-item> -->
                        <el-form-item label="适用终端"  prop="appTerminal">
                          <!-- 多选框组所绑定的变量必须是定义的第一级！！！ -->
                          <el-checkbox-group v-model="appTermianl" @change="changeCheckBox4AppTermianl" ><!--:min="1" :max="2" -->
                            <el-checkbox label="1" >Web</el-checkbox>
                            <el-checkbox label="2" >IOS</el-checkbox>
                            <el-checkbox label="3" >Android</el-checkbox>
                            <!-- <el-checkbox label="4" >IOS+Android</el-checkbox> -->
                          </el-checkbox-group>
                        </el-form-item>
                        <!-- <el-form-item >
                          <template v-for="checkb in checkBox" >
                          <input type='checkbox' name='checkboxinput' class='input-checkbox' v-model='checkBox' value='{{checkb.index}}'>{{checkb.termianl}}</input>
                          </template>
                        </el-form-item> -->
                        <el-form-item label="访问管控" v-if="false">
                          <el-radio-group v-model="extendForm.accessControl">
                            <el-radio class="radio" :label="1">是</el-radio>
                            <el-radio class="radio" :label="0">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                        <el-form-item label="是否启用" v-if="false">
                          <el-radio-group v-model="extendForm.isEnable">
                            <el-radio class="radio" :label="1">是</el-radio>
                            <el-radio class="radio" :label="0">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                        <el-form-item label="是否默认系统应用" v-if="false">
                          <el-radio-group v-model="extendForm.isDefault">
                            <el-radio class="radio" :label="1">是</el-radio>
                            <el-radio class="radio" :label="0">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                        <el-form-item label="是否需要预安装" v-if="false">
                          <el-radio-group v-model="extendForm.isPreInstall">
                            <el-radio class="radio" :label="1">是</el-radio>
                            <el-radio class="radio" :label="0">否</el-radio>
                          </el-radio-group>
                        </el-form-item>
                        <!-- <el-form-item label="附件"> -->

                          <!-- <el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-remove="handleRemove"
                          :before-remove="beforeRemove"  multiple  :limit="3"  :on-exceed="handleExceed" :file-list="fileList">
                          <el-button size="small" type="primary">点击上传</el-button> -->
                          <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/pngk文件，且不超过500kb</div> -->
                        <!-- </el-upload> -->
                        <!-- </el-form-item> -->
                        <!-- <el-form-item label="图片"></el-form-item> -->
                        <el-form-item label="附件" prop="logoImage">
                      <template>
                      <div>
                        <el-upload
                                :data="fileListData"
                                class="upload-demo"
                                ref="fileUplod"
                                :action="uploadUrl"
                                :on-remove="handleRemove"
                                :before-remove="beforeRemove"
                                :file-list="fileList_Unlimited"
                                :limit="1"
                                :on-exceed="handleExceed"
                                :auto-upload="false"
                                :on-success="fileuploadSuccess"
                                v-model="extendForm.attachment">
                            <el-button slot="trigger" size="small" type="primary">选择附件</el-button>
                            <el-button style="margin-left: 10px;" size="small" type="success" @click="submitFile">上传到服务器</el-button>
                        <el-input v-model="extendForm.attachment"  placeholder="附件"></el-input>
                        </el-upload>
                      </div>
                      </template>
                      </el-form-item>
                      <el-form-item label="图片" prop="logoImage">
                      <template>
                      <div>
                        <el-upload
                                :data="picListData"
                                class="upload-demo"
                                ref="picUplod"
                                :action="uploadUrl"
                                :on-remove="handleRemove"
                                :before-remove="beforeRemove"
                                :file-list="picList"
                                :limit="4"
                                :on-exceed="handleExceed"
                                :auto-upload="false"
                                :on-success="picUploadSuccess"
                                v-model="extendForm.detailImage">
                            <el-button slot="trigger" size="small" type="primary">选择图片</el-button>
                            <el-button style="margin-left: 10px;" size="small" type="success" @click="submitPic_4">上传到服务器</el-button>
                        <el-input v-model="extendForm.detailImage"  placeholder="应用截图"></el-input>
                        </el-upload>
                      </div>
                      </template>
                      </el-form-item>
                      </el-form>
                    </el-tab-pane>
                    <!-- <el-tab-pane label="Api接口信息" name="third">
                      <el-row class="tac">
                        <el-col  >
                          <el-button plain @click="apiAdd">新增Api接口</el-button>
                          <el-form :model="apiTab" ref="apiTab"  >
                          <el-table :data="apiTableList" highlight-current-row v-loading="apiListLoading" style="width: 100%"  >
                            <el-table-column prop="apiName"  label="API接口名称">
                            </el-table-column>
                            <el-table-column prop="apiAddrss" label="API接口地址">
                            </el-table-column>
                            <el-table-column prop="gatewayAddrss" label="网关地址">
                            </el-table-column>
                            <el-table-column prop="updateDate" label="修改时间" :formatter="formatUpdateDate">
                            </el-table-column>
                            <el-table-column fixed="right" label="操作" width="90">
                            <template slot-scope="scope">
                              <el-button  @click="tabEdit(scope.$index, scope.row)" type="text" size="small">编辑</el-button>
                              <el-button  @click="modal16 = true" type="text">编辑</el-button>
                              <el-button  @click="tabEdit(scope.$index, scope.row)" type="text">编辑</el-button>
                              <el-button @click="apiDelete(scope.$index, scope.row)" type="text" size="small">删除</el-button>
                            </template>
                            </el-table-column>
                          </el-table>
                          </el-form>
                        </el-col>
                        <el-col :span="24" class="toolbar">
                          <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentAPiPageChange"
                                          :current-page="apiPageNum" :page-size="pageSize" :total="apiTotal">
                          </el-pagination>
                        </el-col>
                        </el-row>
                    </el-tab-pane> -->
                  </el-tabs>
                  </el-form>
                  <span slot="footer" class="dialog-footer">
                      <el-button @click="editdialogVisible = false">取 消</el-button>
                      <el-button type="primary" @click.native="editSubmit" :loading="editLoading" >确 定</el-button>
                  </span>
                </el-dialog>
                    <el-dialog title="版本信息"  :visible.sync="versionDialogVisible" :modal-append-to-body="false">
                      <el-form :model="versionTab" ref="versionTab"  >
                      <el-tabs v-model="activeTab" @tab-click="handleClick">
                          <el-tab-pane label="Web" name="first">
                            <el-col  >
                               <el-form :inline="true" :model="filters2">
                                <el-form-item >
                                <el-button plain @click="webAdd">新增Web版本</el-button>
                                </el-form-item>
                                <el-form-item style="float:right">
                                  <el-button type="primary" v-on:click="webList">查询</el-button>
                                </el-form-item>
                                <el-form-item style="float:right">
                                <el-input  v-model="filters2.version"  class="demo-input-suffix" placeholder="请输入版本号"></el-input>
                                </el-form-item>

                               </el-form>
                              <el-table  :data="webTableList" highlight-current-row v-loading="webListLoading" style="width: 100%;">
                                <el-table-column type="selection" >
                                </el-table-column>
                                <el-table-column prop="appName"  label="应用名称" >
                                </el-table-column>
                                <!-- <el-table-column prop="appCode" label="应用编码" >
                                </el-table-column> -->
                                <!-- <el-table-column prop="versionType" label="版本类型" :formatter="formatVersion">
                                </el-table-column> -->
                                <el-table-column prop="version" label="版本号">
                                </el-table-column>
                                <el-table-column prop="creater" label="创建人">
                                </el-table-column>
                                <el-table-column prop="createDate" label="创建时间" min-width="170px" :formatter="formatCreateDate">
                                </el-table-column>
                                <el-table-column prop="currentVersion" label="是否当前版本" :formatter="formatCurrentVersion">
                                </el-table-column>
                                <el-table-column fixed="right" label="操作" width="180">
                                  <template slot-scope="scope">
                                  <el-button @click="view(scope.$index, scope.row)" type="text" size="small">查看</el-button>
                                  <!-- <el-button type="text" size="small">编辑</el-button> -->
                                  <el-button @click="putDown(scope.$index, scope.row)" v-if="scope.row.currentVersion === 1 && scope.row.publish === 1" type="text" size="small">下架</el-button>
                                  <el-button @click="check(scope.$index, scope.row)" v-if="scope.row.currentVersion != 1 && scope.row.publish === 1" type="text" size="small">设为当前版本</el-button>
                                  <el-button @click="publishVersion(scope.$index, scope.row)" v-if="scope.row.currentVersion != 1 && scope.row.publish != 1" type="text" size="small">发布版本</el-button>
                                  </template>
                                </el-table-column>
                           </el-table>
                          </el-col>
                          <el-col :span="24" class="toolbar">
                            <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentWebPageChange"
                                            :current-page="webPageNum" :page-size="webPageSize" :total="webTotal">
                            </el-pagination>
                          </el-col>
                          </el-tab-pane>
                          <el-tab-pane label="IOS" name="second">
                            <el-col  >
                              <el-form :inline="true" :model="filters2">
                                <el-form-item >
                                <el-button plain @click="iosAdd">新增IOS版本</el-button>
                                </el-form-item>
                                <el-form-item style="float:right">
                                  <el-button type="primary" v-on:click="iosList">查询</el-button>
                                </el-form-item>
                                <el-form-item style="float:right" >
                                <el-input  v-model="filters3.version"  class="demo-input-suffix" placeholder="版本号"></el-input>
                                </el-form-item>
                              </el-form>
                              <el-table :data="iosTableList" highlight-current-row v-loading="iosListLoading"   >
                                <el-table-column type="selection" >
                                </el-table-column>
                                <el-table-column prop="appName"  label="应用名称" >
                                </el-table-column>
                                <el-table-column prop="appCode" label="应用编码" >
                                </el-table-column>
                                <el-table-column prop="versionType" label="版本类型" :formatter="formatVersion">
                                </el-table-column>
                                <el-table-column prop="version" label="版本号">
                                </el-table-column>
                                <el-table-column prop="currentVersion" label="当前版本" :formatter="formatCurrentVersion">
                                </el-table-column>
                                <el-table-column prop="creater" label="创建人">
                                </el-table-column>
                                <el-table-column prop="updateDate" label="修改时间" :formatter="formatUpdateDate">
                                </el-table-column>
                                <el-table-column fixed="right" label="操作" width="150">
                                <template slot-scope="scope">
                                <el-button @click="view(scope.$index, scope.row)" type="text" size="small">查看</el-button>
                                <el-button @click="putDown(scope.$index, scope.row)" v-if="scope.row.currentVersion === 1" type="text" size="small">下架</el-button>
                                <el-button @click="check(scope.$index, scope.row)" type="text" size="small" v-else>设为当前版本</el-button>
                                <!-- <el-button type="text" size="small">编辑</el-button> -->
                                </template>
                                </el-table-column>
                           </el-table>
                          </el-col>
                          <el-col  class="toolbar">
                            <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentIosPageChange"
                                            :current-page="iosPageNum" :page-size="pageSize" :total="iosTotal">
                            </el-pagination>
                          </el-col>
                          </el-tab-pane>
                          <el-tab-pane label="Android" name="third">
                            <el-col  >
                              <el-form :inline="true" :model="filters2">
                                <el-form-item >
                                <el-button plain @click="androidAdd">新增Android版本</el-button>
                                </el-form-item>
                                <el-form-item style="float:right">
                                  <el-button type="primary" v-on:click="androidList">查询</el-button>
                                </el-form-item>
                                <el-form-item style="float:right">
                                <el-input  v-model="filters4.version"  class="demo-input-suffix" placeholder="版本号"></el-input>
                                </el-form-item>
                              </el-form>
                              <el-table :data="androidTableList" highlight-current-row v-loading="androidListLoading"  >
                                <el-table-column type="selection" >
                                </el-table-column>
                                <el-table-column prop="appName"  label="应用名称" >
                                </el-table-column>
                                <el-table-column prop="appCode" label="应用编码" >
                                </el-table-column>
                                <el-table-column prop="versionType" label="版本类型" :formatter="formatVersion">
                                </el-table-column>
                                <el-table-column prop="version" label="版本号">
                                </el-table-column>
                                <el-table-column prop="currentVersion" label="当前版本" :formatter="formatCurrentVersion">
                                </el-table-column>
                                <el-table-column prop="creater" label="创建人">
                                </el-table-column>
                                <el-table-column prop="updateDate" label="修改时间" :formatter="formatUpdateDate">
                                </el-table-column>
                                <el-table-column fixed="right" label="操作" width="150">
                                <template slot-scope="scope">
                                <el-button @click="view(scope.$index, scope.row)" type="text" size="small">查看</el-button>
                                <el-button @click="putDown(scope.$index, scope.row)" v-if="scope.row.currentVersion === 1" type="text" size="small">下架</el-button>
                                <el-button @click="check(scope.$index, scope.row)" type="text" size="small" v-else>设为当前版本</el-button>
                                </template>
                                </el-table-column>
                           </el-table>
                          </el-col>
                          <el-col :span="24" class="toolbar">
                            <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentAndroidPageChange"
                                            :current-page="androidPageNum" :page-size="pageSize" :total="androidTotal">
                            </el-pagination>
                          </el-col>
                          </el-tab-pane>
                      </el-tabs>
                      </el-form>
                      <span slot="footer" class="dialog-footer">
                          <el-button @click="versionDialogVisible = false">取 消</el-button>
                          <el-button type="primary" @click="versionDialogVisible = false">确 定</el-button>
                      </span>
                    </el-dialog>
             <!-- 新增弹框-->
            <el-dialog  title="应用注册" :visible.sync="appDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
                  <el-form-item label="市   场 " prop="appMarket" v-if="false">
                    <el-select  placeholder="请选择" v-model="addForm.appMarket">
                      <el-option  v-for="item in market" :key="item.marketCode" :value="item.marketCode" :label="item.marketName"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="应用名称" prop="appName">
                    <el-input v-model="addForm.appName"></el-input>
                  </el-form-item>
                  <el-form-item label="应用编码" prop="appCode">
                    <el-input v-model="addForm.appCode"></el-input>
                  </el-form-item>
                  <el-form-item label="应用分类"  prop="appType">
                    <el-select  placeholder="请选择" v-model="addForm.appType">
                      <el-option v-for="item in clazz" :key="item.classCode" :value="item.classCode" :label="item.className"></el-option>
                    </el-select>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="appDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click.native="addSubmit" :loading="addLoading">保 存</el-button>
              </div >
            </el-dialog>
             <!-- 新增api弹框-->
            <el-dialog  title="新增API接口" :visible.sync="apiDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="apiForm" label-width="120px" :rules="apiFormRules" ref="apiForm">
                  <el-form-item label="API接口名称" prop="apiName">
                  <el-select placeholder="请选择" filterable v-model="apiForm.apiName" @change="apiSelectChange($event,'apiAdd')">
                    <el-option v-for="item in apiData" :key="item.id" :label="item.name" :value="item.name">
                    </el-option>
                  </el-select>
                  </el-form-item>
                  <!-- <el-form-item label="API接口名称" prop="apiName">
                    <el-input v-model="apiForm.apiName"></el-input>
                  </el-form-item> -->
                  <el-form-item label="API接口地址" prop="apiAddrss">
                    <el-input v-model="apiForm.apiAddrss" :disabled="false"></el-input>
                  </el-form-item>
                  <el-form-item label="网关地址" prop="gatewayAddrss">
                    <el-input v-model="apiForm.gatewayAddrss" :disabled="false"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="apiDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click.native="saveApi" :loading="addLoading">保 存</el-button>
              </div >
            </el-dialog>
            <!-- 编辑api -->
            <!-- <el-dialog  title="编辑" :visible.sync="apiEditDialogVisible" :modal-append-to-body="false" width="30%" center> -->
               <Modal v-model="modal16" title="编辑"  width='30%'>
               <el-form :model="apiEditForm" label-width="120px"   ref="apiEditForm">
                  <!-- <el-form-item label="API接口名称" prop="apiName">
                    <el-input v-model="apiEditForm.apiName"></el-input>
                  </el-form-item> -->
                  <el-form-item label="API接口名称" prop="apiName">
                  <el-select placeholder="请选择" filterable v-model="apiEditForm.apiName" @change="apiSelectChange($event,'apiEdit')">
                    <el-option v-for="item in apiData" :key="item.id" :label="item.name" :value="item.name">
                    </el-option>
                  </el-select>
                  </el-form-item>
                  <el-form-item label="API接口地址" prop="apiAddrss">
                    <el-input v-model="apiEditForm.apiAddrss" :disabled="false"></el-input>
                  </el-form-item>
                  <el-form-item label="网关地址" prop="gatewayAddrss">
                    <el-input v-model="apiEditForm.gatewayAddrss" :disabled="false"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="modal16 = false">关 闭</el-button>
                <el-button type="primary" @click.native="apiEditSubmit" :loading="addLoading">保 存</el-button>
              </div >
               </Modal>
            <!-- </el-dialog>   -->
            <!-- 新增Web版本信息-->
            <el-dialog  title="新增WEB类版本信息" :visible.sync="webDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="webForm" label-width="120px" :rules="webFormRules" ref="webForm">
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="webForm.version"><template slot="prepend">v</template></el-input>
                  </el-form-item>
                  <el-form-item label="默认程序包">
                    <el-radio-group v-model="webForm.defaultPackage">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="窗口状态"  prop="winType">
                    <el-select v-model="webForm.winType" placeholder="是否推荐">
                      <el-option label="最大化" value="0"></el-option>
                      <el-option label="横向布局" value="1"></el-option>
                      <el-option label="纵向布局" value="2"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="是否依赖云">
                    <el-radio-group v-model="webForm.isRelyOnColud">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="URL地址" prop="accessUrl">
                    <el-input v-model="webForm.accessUrl"></el-input>
                  </el-form-item>
                  <el-form-item label="待办数地址" prop="urlNum">
                    <el-input v-model="webForm.urlNum"></el-input>
                  </el-form-item>
                  <el-form-item label="描述" prop="remark">
                    <el-input type="textarea" v-model="webForm.remark"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="webDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click="webConfirm" :loading="addLoading">提交发布</el-button>
                <el-button type="primary" @click.native="saveWeb" :loading="addLoading">保 存</el-button>
              </div >
            </el-dialog>
            <!-- 查看Web版本信息-->
            <el-dialog  title="版本信息" :visible.sync="webDetailDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="webDetailForm" label-width="120px" :rules="webFormRules" ref="webForm">
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="webDetailForm.version" :disabled="true"><template slot="prepend">v</template></el-input>
                  </el-form-item>
                  <el-form-item label="默认程序包">
                    <el-radio-group v-model="webDetailForm.defaultPackage" :disabled="true">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="窗口状态"  prop="winType">
                    <el-select v-model="webDetailForm.winType" placeholder="是否推荐" :disabled="true">
                      <el-option label="最大化" value="0"></el-option>
                      <el-option label="横向布局" value="1"></el-option>
                      <el-option label="纵向布局" value="2"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="是否依赖云">
                    <el-radio-group v-model="webDetailForm.isRelyOnColud" :disabled="true">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="URL地址" prop="accessUrl">
                    <el-input v-model="webDetailForm.accessUrl" :disabled="true"></el-input>
                  </el-form-item>
                  <el-form-item label="待办数地址" prop="urlNum">
                    <el-input v-model="webDetailForm.urlNum" :disabled="true"></el-input>
                  </el-form-item>
                  <el-form-item label="描述" prop="remark">
                    <el-input type="textarea" v-model="webDetailForm.remark" :disabled="true"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="webDetailDialogVisible = false">关 闭</el-button>
              </div >
            </el-dialog>
            <!-- Web版本信息确认-->
            <el-dialog  title="版本信息确认" :visible.sync="webConfirmDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="webConfirmForm" label-width="120px"  ref="webConfirmForm">
                  <el-form-item label="应用编码" prop="appCode">
                    <el-input v-model="webConfirmForm.appCode"></el-input>
                  </el-form-item>
                  <el-form-item label="应用名称" prop="appName">
                    <el-input v-model="webConfirmForm.appName"></el-input>
                  </el-form-item>
                  <!--<el-form-item label="LOGO" prop="logoImage">-->
                    <!--<el-input v-model="webConfirmForm.logoImage"></el-input>-->
                  <!--</el-form-item>-->
                   <!--<el-form-item label="应用图标" prop="logoImage">-->
                       <!--<template>-->
                           <!--<div>-->
                               <!--<el-upload-->
                                       <!--:data="paramData"-->
                                       <!--class="upload-demo"-->
                                       <!--ref="upload"-->
                                       <!--:action="uploadUrl"-->
                                       <!--:on-remove="handleRemove"-->
                                       <!--:before-remove="beforeRemove"-->
                                       <!--:file-list="fileList"-->
                                       <!--:limit="1"-->
                                       <!--:on-exceed="handleExceed"-->
                                       <!--:auto-upload="false"-->
                                       <!--:on-success="uploadSuccess"-->
                                       <!--v-model="editForm.logoImage">-->
                                   <!--<el-button slot="trigger" size="small" type="primary">选取图片</el-button>-->
                                   <!--<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>-->
                                   <!--<el-input v-model="editForm.logoImage"  placeholder="应用图标" disabled></el-input>-->
                               <!--</el-upload>-->
                           <!--</div>-->
                       <!--</template>-->
                   <!--</el-form-item>-->
                   <el-form-item label="LOGO" prop="logoImage">
                       <template>
                           <div>
                               <el-upload
                                       :data="webConfirmForm.logoImage"
                                       class="upload-demo"
                                       ref="upload_LOGO"
                                       :action="uploadUrl"
                                       :on-remove="handleRemove"
                                       :before-remove="beforeRemove"
                                       :file-list="fileList"
                                       :limit="1"
                                       :on-exceed="handleExceed"
                                       :auto-upload="false"
                                       :on-success="uploadSuccess_LOGO"
                                       v-model="webConfirmForm.logoImage">
                                   <el-button slot="trigger" size="small" type="primary">选取图片</el-button>
                                   <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload_LOGO">上传到服务器</el-button>
                                   <el-input v-model="editForm.logoImage"  placeholder="应用图标" disabled></el-input>
                               </el-upload>
                           </div>
                       </template>
                   </el-form-item>

                  <el-form-item label="市场" prop="appMarket">
                    <el-input v-model="webConfirmForm.appMarket"></el-input>
                  </el-form-item>
                  <el-form-item label="应用分类" prop="appType">
                    <el-input v-model="webConfirmForm.appType"></el-input>
                  </el-form-item>
                  <el-form-item label="应用介绍" prop="remark">
                    <el-input v-model="webConfirmForm.remark"></el-input>
                  </el-form-item>
                  <el-form-item label="上传附件" prop="attachment">
                  </el-form-item>
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="webConfirmForm.version"></el-input>
                  </el-form-item>
                  <el-form-item label="默认程序包">
                    <el-radio-group v-model="webConfirmForm.installPackage">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="窗口状态" prop="winType">
                    <el-input v-model="webConfirmForm.winType"></el-input>
                  </el-form-item>
                  <el-form-item label="是否依赖云">
                    <el-radio-group v-model="webConfirmForm.isRelyOnColud">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="入口地址" prop="accessUrl">
                    <el-input v-model="webConfirmForm.accessUrl"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="webConfirmDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click.native="toPublish(webConfirmForm.versionType)"  :loading="publishLoading">确认发布</el-button>
              </div >
            </el-dialog>
            <!-- 新增IOS版本信息-->
            <el-dialog  title="新增IOS类版本信息" :visible.sync="iosDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="iosForm" label-width="120px" :rules="iosFormRules" ref="iosForm">
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="iosForm.version"><template slot="prepend">v</template></el-input>
                  </el-form-item>
                  <el-form-item label="是否云编译">
                    <el-radio-group v-model="iosForm.compile">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="强制更新">
                    <el-radio-group v-model="iosForm.forceUpdate">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="是否静默安装">
                    <el-radio-group v-model="iosForm.isDefaultInstall">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="验证类型"  prop="validateType">
                    <el-select v-model="iosForm.validateType" placeholder="验证类型">
                      <el-option label="单点登录验证" value="0"></el-option>
                      <el-option label="不验证" value="1"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="开发框架类型"  prop="frameType">
                    <el-select v-model="iosForm.frameType" placeholder="开发框架类型">
                      <el-option label="原生开发" value="0"></el-option>
                      <el-option label="BingoTouch" value="1"></el-option>
                      <el-option label="标准WEB程序" value="2"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="安装包路径" prop="installPackageUrl">
                    <el-input v-model="iosForm.installPackageUrl"></el-input>
                  </el-form-item>
                  <!-- <el-form-item label="安装包">
                  </el-form-item> -->
                   <el-form-item label="安装包" prop="installPackage">
                      <template>
                      <div>
                        <el-upload
                                :data="iosListData"
                                class="upload-demo"
                                ref="iosUplod"
                                :action="uploadUrl"
                                :on-remove="handleRemove"
                                :before-remove="beforeRemove"
                                :file-list="iosApkList"
                                :limit="4"
                                :on-exceed="handleExceed"
                                :auto-upload="false"
                                :on-success="iosUploadSuccess"
                                v-model="iosForm.installPackage">
                            <el-button slot="trigger" size="small" type="primary">选择图片</el-button>
                            <el-button style="margin-left: 10px;" size="small" type="success" @click="submitIOS_apk">上传到服务器</el-button>
                        <!-- <el-input v-model="extendForm.detailImage"  placeholder="应用截图"></el-input> -->
                        </el-upload>
                      </div>
                      </template>
                      </el-form-item>
                  <el-form-item label="安装包大小" prop="installPackageSize">
                    <el-input v-model="iosForm.installPackageSize"></el-input>
                  </el-form-item>
                  <el-form-item label="入口地址" prop="accessUrl">
                    <el-input v-model="iosForm.accessUrl"></el-input>
                  </el-form-item>
                  <el-form-item label="启动配置项" prop="startupConfig">
                    <el-input v-model="iosForm.startupConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="扩展配置" prop="extendConfig">
                    <el-input v-model="iosForm.extendConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="描述" prop="remark">
                    <el-input type="textarea" v-model="iosForm.remark"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="iosDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click="iosConfirm" :loading="addLoading">提交发布</el-button>
                <el-button type="primary" @click.native="saveIOS" :loading="addLoading">保 存</el-button>
              </div >
            </el-dialog>
            <!-- 查看IOS版本信息-->
            <el-dialog  title="版本信息" :visible.sync="iosDetailDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="iosDetailForm" label-width="120px" :rules="iosFormRules" ref="iosForm">
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="iosDetailForm.version"><template slot="prepend">v</template></el-input>
                  </el-form-item>
                  <el-form-item label="是否云编译">
                    <el-radio-group v-model="iosDetailForm.compile">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="强制更新">
                    <el-radio-group v-model="iosDetailForm.forceUpdate">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="是否静默安装">
                    <el-radio-group v-model="iosDetailForm.isDefaultInstall">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="验证类型"  prop="validateType">
                    <el-select v-model="iosDetailForm.validateType" placeholder="是否推荐">
                      <el-option label="单点登录验证" value="0"></el-option>
                      <el-option label="不验证" value="1"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="开发框架类型"  prop="frameType">
                    <el-select v-model="iosDetailForm.frameType" placeholder="是否推荐">
                      <el-option label="原生开发" value="0"></el-option>
                      <el-option label="BingoTouch" value="1"></el-option>
                      <el-option label="标准WEB程序" value="2"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="安装包路径" prop="installPackageUrl">
                    <el-input v-model="iosDetailForm.apiAddrss"></el-input>
                  </el-form-item>
                  <el-form-item label="安装包">
                  </el-form-item>
                  <el-form-item label="安装包大小" prop="installPackageSize">
                    <el-input v-model="iosDetailForm.installPackageSize"></el-input>
                  </el-form-item>
                  <el-form-item label="入口地址" prop="accessUrl">
                    <el-input v-model="iosDetailForm.accessUrl"></el-input>
                  </el-form-item>
                  <el-form-item label="启动配置项" prop="startupConfig">
                    <el-input v-model="iosDetailForm.startupConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="扩展配置" prop="extendConfig">
                    <el-input v-model="iosDetailForm.extendConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="描述" prop="remark">
                    <el-input type="textarea" v-model="iosDetailForm.remark"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="iosDetailDialogVisible = false">关 闭</el-button>
              </div >
            </el-dialog>
            <!-- IOS版本信息确认-->
            <el-dialog  title="版本信息确认" :visible.sync="iosConfirmDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="iosConfirmForm" label-width="120px"  ref="iosConfirmForm">
                  <el-form-item label="应用编码" prop="appCode">
                    <el-input v-model="iosConfirmForm.appCode"></el-input>
                  </el-form-item>
                  <el-form-item label="应用名称" prop="appName">
                    <el-input v-model="iosConfirmForm.appName"></el-input>
                  </el-form-item>
                  <el-form-item label="LOGO" prop="logoImage">
                    <el-input v-model="iosConfirmForm.logoImage"></el-input>
                  </el-form-item>
                  <el-form-item label="市场" prop="appMarket">
                    <el-input v-model="iosConfirmForm.appMarket"></el-input>
                  </el-form-item>
                  <el-form-item label="应用分类" prop="appType">
                    <el-input v-model="iosConfirmForm.appType"></el-input>
                  </el-form-item>
                  <el-form-item label="应用介绍" prop="remark">
                    <el-input v-model="iosConfirmForm.remark"></el-input>
                  </el-form-item>
                  <el-form-item label="上传附件" prop="attachment">
                  </el-form-item>
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="iosConfirmForm.version"></el-input>
                  </el-form-item>
                  <el-form-item label="安装包路径">
                    <el-input v-model="iosConfirmForm.installPackageUrl"></el-input>
                  </el-form-item >
                  <el-form-item label="入口地址" prop="accessUrl">
                    <el-input v-model="iosConfirmForm.accessUrl"></el-input>
                  </el-form-item>
                  <el-form-item label="安全检查报告" prop="version">
                    <el-input v-model="iosConfirmForm.version"></el-input><!-- 安全检查未实现-->
                  </el-form-item>
                  <el-form-item label="查看" prop="version">
                    <el-input v-model="iosConfirmForm.version"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="iosConfirmDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click.native="toPublish(iosConfirmForm.versionType)"  :loading="publishLoading">确认发布</el-button>
              </div >
            </el-dialog>
            <!-- 新增Android版本信息-->
            <el-dialog  title="新增Android类版本信息" :visible.sync="androidDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="androidForm" label-width="120px" :rules="androidFormRules" ref="androidForm">
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="androidForm.version"><template slot="prepend">v</template></el-input>
                  </el-form-item>
                  <el-form-item label="是否云编译">
                    <el-radio-group v-model="androidForm.compile">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="强制更新">
                    <el-radio-group v-model="androidForm.forceUpdate">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="是否静默安装">
                    <el-radio-group v-model="androidForm.isDefaultInstall">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="验证类型"  prop="validateType">
                    <el-select v-model="androidForm.validateType" placeholder="验证类型">
                      <el-option label="单点登录验证" value="0"></el-option>
                      <el-option label="不验证" value="1"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="开发框架类型"  prop="frameType">
                    <el-select v-model="androidForm.frameType" placeholder="开发框架类型">
                      <el-option label="原生开发" value="0"></el-option>
                      <el-option label="BingoTouch" value="1"></el-option>
                      <el-option label="标准WEB程序" value="2"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="安装包路径" prop="installPackageUrl">
                    <el-input v-model="androidForm.installPackageUrl"></el-input>
                  </el-form-item>
                  <!-- <el-form-item label="安装包">
                  </el-form-item> -->
                  <el-form-item label="安装包" prop="installPackage">
                      <template>
                      <div>
                        <el-upload
                                :data="androidListData"
                                class="upload-demo"
                                ref="androidUplod"
                                :action="uploadUrl"
                                :on-remove="handleRemove"
                                :before-remove="beforeRemove"
                                :file-list="androidApkList"
                                :limit="4"
                                :on-exceed="handleExceed"
                                :auto-upload="false"
                                :on-success="andoridUploadSuccess"
                                v-model="androidForm.installPackage">
                            <el-button slot="trigger" size="small" type="primary">选择图片</el-button>
                            <el-button style="margin-left: 10px;" size="small" type="success" @click="submitAndroid_apk">上传到服务器</el-button>
                        <!-- <el-input v-model="extendForm.detailImage"  placeholder="应用截图"></el-input> -->
                        </el-upload>
                      </div>
                      </template>
                      </el-form-item>
                  <el-form-item label="安装包大小" prop="installPackageSize">
                    <el-input v-model="androidForm.installPackageSize"></el-input>
                  </el-form-item>
                  <el-form-item label="入口地址" prop="gatewayAddrss">
                    <el-input v-model="androidForm.gatewayAddrss"></el-input>
                  </el-form-item>
                  <el-form-item label="启动配置项" prop="startupConfig">
                    <el-input v-model="androidForm.startupConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="扩展配置" prop="extendConfig">
                    <el-input v-model="androidForm.extendConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="描述" prop="remark">
                    <el-input type="textarea" v-model="androidForm.remark"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="androidDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click="androidConfirm" :loading="addLoading">提交发布</el-button>
                <el-button type="primary" @click.native="saveAndroid" :loading="addLoading">保 存</el-button>
              </div >
            </el-dialog>
            <!-- 查看Android版本信息-->
            <el-dialog  title="版本信息" :visible.sync="androidDetailDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="androidDetailForm" label-width="120px" :rules="androidFormRules" ref="androidForm">
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="androidDetailForm.version"><template slot="prepend">v</template></el-input>
                  </el-form-item>
                  <el-form-item label="是否云编译">
                    <el-radio-group v-model="androidDetailForm.compile">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="强制更新">
                    <el-radio-group v-model="androidDetailForm.forceUpdate">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="是否静默安装">
                    <el-radio-group v-model="androidDetailForm.isDefaultInstall">
                      <el-radio class="radio" :label="1">是</el-radio>
                      <el-radio class="radio" :label="0">否</el-radio>
                    </el-radio-group>
                  </el-form-item>
                  <el-form-item label="验证类型"  prop="validateType">
                    <el-select v-model="androidDetailForm.validateType" placeholder="验证类型">
                      <el-option label="单点登录验证" value="0"></el-option>
                      <el-option label="不验证" value="1"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="开发框架类型"  prop="frameType">
                    <el-select v-model="androidDetailForm.frameType" placeholder="开发框架类型">
                      <el-option label="原生开发" value="0"></el-option>
                      <el-option label="BingoTouch" value="1"></el-option>
                      <el-option label="标准WEB程序" value="2"></el-option>
                    </el-select>
                  </el-form-item >
                  <el-form-item label="安装包路径" prop="installPackageUrl">
                    <el-input v-model="androidDetailForm.installPackageUrl"></el-input>
                  </el-form-item>
                  <el-form-item label="安装包">
                  </el-form-item>
                  <el-form-item label="安装包大小" prop="installPackageSize">
                    <el-input v-model="androidDetailForm.installPackageSize"></el-input>
                  </el-form-item>
                  <el-form-item label="入口地址" prop="gatewayAddrss">
                    <el-input v-model="androidDetailForm.gatewayAddrss"></el-input>
                  </el-form-item>
                  <el-form-item label="启动配置项" prop="startupConfig">
                    <el-input v-model="androidDetailForm.startupConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="扩展配置" prop="extendConfig">
                    <el-input v-model="androidDetailForm.extendConfig"></el-input>
                  </el-form-item>
                  <el-form-item label="描述" prop="remark">
                    <el-input type="textarea" v-model="androidDetailForm.remark"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="androidDetailDialogVisible = false">关 闭</el-button>
              </div >
            </el-dialog>
            <!-- android版本信息确认-->
            <el-dialog  title="版本信息确认" :visible.sync="androidConfirmDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="androidConfirmForm" label-width="120px"  ref="androidConfirmForm">
                  <el-form-item label="应用编码" prop="appCode">
                    <el-input v-model="androidConfirmForm.appCode"></el-input>
                  </el-form-item>
                  <el-form-item label="应用名称" prop="appName">
                    <el-input v-model="androidConfirmForm.appName"></el-input>
                  </el-form-item>
                  <el-form-item label="LOGO" prop="logoImage">
                    <el-input v-model="androidConfirmForm.logoImage"></el-input>
                  </el-form-item>
                  <el-form-item label="市场" prop="appMarket">
                    <el-input v-model="androidConfirmForm.appMarket"></el-input>
                  </el-form-item>
                  <el-form-item label="应用分类" prop="appType">
                    <el-input v-model="androidConfirmForm.appType"></el-input>
                  </el-form-item>
                  <el-form-item label="应用介绍" prop="remark">
                    <el-input v-model="androidConfirmForm.remark"></el-input>
                  </el-form-item>
                  <el-form-item label="上传附件" prop="attachment">
                  </el-form-item>
                  <el-form-item label="版本号" prop="version">
                    <el-input v-model="androidConfirmForm.version"></el-input>
                  </el-form-item>
                  <el-form-item label="安装包路径">
                    <el-input v-model="androidForm.installPackageUrl"></el-input>
                  </el-form-item>
                  <el-form-item label="入口地址" prop="accessUrl">
                    <el-input v-model="androidConfirmForm.version"></el-input>
                  </el-form-item>
                  <el-form-item label="安全检查报告" prop="version">
                    <el-input v-model="androidConfirmForm.accessUrl"></el-input>
                  </el-form-item>
                  <el-form-item label="查看" prop="version">
                    <el-input v-model="androidConfirmForm.version"></el-input>
                  </el-form-item>
               </el-form>
              <div  slot="footer" class="dialog-footer">
                <el-button @click="androidConfirmDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click.native="toPublish(androidConfirmForm.versionType)"  :loading="publishLoading" >确认发布</el-button>
              </div >
            </el-dialog>
            <!--                            选择发布终端       -->
            <el-dialog title="终端版本" :visible.sync="choiceVersionDialogVisible" :modal-append-to-body="false" width="30%" center>
              <el-form :model="appPublishFrom" label-width="150px">
                <el-form-item label="应用编码">
                  <el-input v-model="appPublishFrom.appCode"  placeholder="应用编码"  :disabled="true" style="width: 58%;"></el-input>
                </el-form-item>
                <el-form-item label="应用名称">
                  <el-input v-model="appPublishFrom.appName"  placeholder="应用名称"  :disabled="true" style="width: 58%;"></el-input>
                </el-form-item>
                <el-form-item label="WEB类版本信息"></el-form-item>
                <!-- <span>WEB类版本信息s</span> -->
                <el-form-item label="版本号" prop="version">
                  <el-select v-model="publishWebInfoFrom.version" @change="linkVersion" placeholder="请选择">
                    <el-option  v-for="item in Web" :key="item.id" :value="item.id" :label="item.version"></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item label="入口地址">
                  <el-input v-model="publishWebInfoFrom.accessUrl"  placeholder="入口地址"  ></el-input>
                </el-form-item> -->
                <!-- <el-form-item label="修改时间">
                  <el-input v-model="publishWebInfoFrom.updateDate"  placeholder="修改时间"  ></el-input>
                </el-form-item> -->
                <!-- <span>IOS类版本信息</span> -->
                <div :model=" publishIOSInfoFrom" ref="publishIOSInfoFrom">
                <el-form-item label="IOS类版本信息"></el-form-item>
                <el-form-item label="版本号" prop="version">
                  <el-select v-model="publishIOSInfoFrom.version" @change="linkVersion" placeholder="请选择">
                    <el-option  v-for="item in IOS" :key="item.id" :value="item.id" :label="item.version"></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item label="安装包">
                  <el-input v-model="publishIOSInfoFrom.installPackage"  placeholder="安装包"  ></el-input>
                </el-form-item> -->
                <!-- <el-form-item label="入口地址">
                  <el-input v-model="publishIOSInfoFrom.accessUrl"  placeholder="入口地址"  ></el-input>
                </el-form-item> -->
                <!-- <el-form-item label="修改时间">
                  <el-input v-model="publishIOSInfoFrom.updateDate"  placeholder="修改时间"  ></el-input>
                </el-form-item> -->
                </div>
                <!-- <span>Android类版本信息</span> -->
                 <div :model="publishAndroidInfoFrom"  ref="publishAndroidInfoFrom">
                <el-form-item label="Android类版本信息"></el-form-item>
                <el-form-item label="版本号" prop="version">
                  <el-select v-model="publishAndroidInfoFrom.version" @change="linkVersion" placeholder="请选择">
                    <el-option  IOS v-for="item in Android" :key="item.id" :value="item.id" :label="item.version"></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item label="安装包">
                  <el-input v-model="publishAndroidInfoFrom.installPackage"  placeholder="安装包"  ></el-input>
                </el-form-item> -->
                <!-- <el-form-item label="入口地址">
                  <el-input v-model="publishAndroidInfoFrom.accessUrl"  placeholder="入口地址"  ></el-input>
                </el-form-item> -->
                <!-- <el-form-item label="修改时间">
                  <el-input v-model="publishAndroidInfoFrom.updateDate"  placeholder="修改时间"  ></el-input>
                </el-form-item> -->
                 </div>
                <span>已选市场</span>
              </el-form>
                  <el-button @click="addPublishMarket" plain style="float:left" >添加</el-button>
              <el-table :data="publishMarketList" style="width: 100%">
                <el-table-column type="index" label="序号" ></el-table-column>
                <!-- <el-table-column type="selection" width="55"></el-table-column> -->
                <el-table-column  prop="marketName" label="市场"></el-table-column>
                <el-table-column  prop="clazz.className" label="应用分类"></el-table-column>
                <!-- <el-table-column  prop="marketType" label="环境类型"></el-table-column> -->
                <!-- <el-table-column  prop="isEnable" label="状态"></el-table-column> -->
                <el-table-column fixed="right" label="操作" width="150">
                <template slot-scope="scope">
                <el-button  type="text" @click="marketDelete(scope.$index, scope.row)" size="small">删除</el-button>
                </template>
                </el-table-column>

              </el-table>
                <el-col :span="24" class="toolbar">
                  <el-pagination layout="total, prev, pager, next, jumper" @current-change="handleCurrentMarketPageChange"
                                  :current-page="marketPageNum" :page-size="pageSize" :total="marketTotal">
                  </el-pagination>
                </el-col>
              <div  slot="footer" class="dialog-footer">
              <el-button  @click="choiceVersionDialogVisible = false">取 消</el-button>
              <el-button type="primary" @click="publishConfirm">确 定</el-button>
              </div >
            </el-dialog>
            <!-- 添加发布市场-->
            <el-dialog title="发布位置" :visible.sync="publishPositionDialogVisible" :modal-append-to-body="false" width="30%" center>
               <el-form :model="addPublishMarketForm" label-width="120px" :rules="addPublishMarketFormRules" ref="addPublishMarketForm">
                  <el-form-item label="市   场 " prop="appMarket">
                    <el-select  placeholder="请选择" v-model="addPublishMarketForm.marketCode">
                      <el-option  v-for="item in market" :key="item.marketCode" :value="item.marketCode" :label="item.marketName"></el-option>
                    </el-select>
                  </el-form-item>
                    <el-form-item label="应用分类">
                    <el-select  placeholder="请选择" v-model="addPublishMarketForm.applictionType">
                      <el-option v-for="item in clazz" :key="item.classCode" :value="item.classCode" :label="item.className"></el-option>
                    </el-select>
                  </el-form-item>
               </el-form>
               <div  slot="footer" class="dialog-footer">
                <el-button @click="publishPositionDialogVisible = false">关 闭</el-button>
                <el-button type="primary" @click="toAddPublishMarket" >添加</el-button>
              </div >
            </el-dialog>

          <!--                   确认发布页面            ==================== -->
            <el-dialog title="应用发布" :visible.sync="publishAppDialogVisible" :modal-append-to-body="false" width="30%" center>
              <el-form :model="appPublishFrom" label-width="150px" >
                <el-form-item label="应用编码">
                  <el-input v-model="appPublishFrom.appCode"  placeholder="应用编码"  ></el-input>
                </el-form-item>
                <el-form-item label="应用名称">
                  <el-input v-model="appPublishFrom.appName"  placeholder="应用名称"  ></el-input>
                </el-form-item>
                <el-form-item label="WEB类版本信息"></el-form-item>
                <!-- <span>WEB类版本信息s</span> -->
                <el-form-item label="版本号" prop="version">
                  <!-- <el-select v-model="publishWebInfoFrom.version" placeholder="请选择">
                    <el-option  v-for="item in market" :key="item.marketCode" :value="item.marketCode" :label="item.marketName"></el-option>
                  </el-select> -->
                  <el-select v-model="publishWebInfoFrom.version" @change="linkVersion" placeholder="请选择">
                    <el-option  v-for="item in Web" :key="item.id" :value="item.id" :label="item.version"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="入口地址">
                  <el-input v-model="publishWebInfoFrom.accessUrl"  placeholder="入口地址"  ></el-input>
                </el-form-item>
                <el-form-item label="修改时间">
                  <el-input v-model="publishWebInfoFrom.updateDate"  placeholder="修改时间"  ></el-input>
                </el-form-item>
                <!-- <span>IOS类版本信息</span> -->
                <el-form-item label="IOS类版本信息"></el-form-item>
                <el-form-item label="版本号" prop="version">
                  <el-select v-model="publishIOSInfoFrom.version" placeholder="请选择">
                    <el-option  v-for="item in market" :key="item.marketCode" :value="item.marketCode" :label="item.marketName"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="安装包">
                  <el-input v-model="publishIOSInfoFrom.installPackage"  placeholder="安装包"  ></el-input>
                </el-form-item>
                <el-form-item label="入口地址">
                  <el-input v-model="publishIOSInfoFrom.accessUrl"  placeholder="入口地址"  ></el-input>
                </el-form-item>
                <el-form-item label="修改时间">
                  <el-input v-model="publishIOSInfoFrom.updateDate"  placeholder="修改时间"  ></el-input>
                </el-form-item>
                <!-- <span>Android类版本信息</span> -->
                <el-form-item label="Android类版本信息"></el-form-item>
                <el-form-item label="版本号" prop="version">
                  <el-select v-model="publishAndroidInfoFrom.version" placeholder="请选择">
                    <el-option  v-for="item in market" :key="item.marketCode" :value="item.marketCode" :label="item.marketName"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="安装包">
                  <el-input v-model="publishAndroidInfoFrom.installPackage"  placeholder="安装包"  ></el-input>
                </el-form-item>
                <el-form-item label="入口地址">
                  <el-input v-model="publishAndroidInfoFrom.accessUrl"  placeholder="入口地址"  ></el-input>
                </el-form-item>
                <el-form-item label="修改时间">
                  <el-input v-model="publishAndroidInfoFrom.updateDate"  placeholder="修改时间"  ></el-input>
                </el-form-item>
                <span>已选市场</span>
              </el-form>
              <el-table :data="allPublishMarketList">
                <el-table-column type="" width="30"></el-table-column>
                <el-table-column  prop="marketName" label="市场"></el-table-column>
                <el-table-column  prop="clazz.className" label="应用分类"></el-table-column>
                <el-table-column  prop="marketType" label="环境类型"></el-table-column>
                <el-table-column  prop="version" label="状态"></el-table-column>
              </el-table>
              <div  slot="footer" class="dialog-footer">
              <el-button  @click="publishAppDialogVisible = false">取 消</el-button>
              <el-button @click.native="doPublish" type="primary" >发 布</el-button>
              </div >
            </el-dialog>
        </Row>
    </div>
</template>

<script>
import util from '../api/util'
import authorize from './components/app-authorize.vue';
// import authDept from './components/app-authorize-dept.vue';

import {doAuthDept,getAppList,getExtendList,getApiList,versionList,getMarketList,
        editApi,getApplicationTypeList,updateVersion,createApi,createVersion,addApp,
        editApp,deleteApi,publishMarket,addPublishMarket ,removeMarket,getpublishMarketList,
        sendObj,getAllPublishMarket,getOrganizationList,getAuth,addAuth,delAuth,getSupplierList,
        searchApimanageService} from '../../api/api';
export default {

  // 组件注册
   components: {
      authorize,
      // authDept
    },
  data() {
    return {
      rowAppObj:'',
      text:'',
      filters: {
        appCode:'',
        appName: '',
        marketName:''
				},
      filters2: {
        version:''
				},
      filters3: {
        version:''
				},
      filters4: {
        version:''
				},
      tableData: [],
      publishMarketList:[],
      apiTableList:[],
      webTableList:[],
      webLists:[],
      iosTableList:[],
      androidTableList:[],
      deptTableData:[],
      supplierData:[],
			total: 0,
      pageNum: 1,
      pageSize:5,
			apiTotal: 0,
      apiPageNum: 1,
      apiPageSize:2,
			webTotal: 0,
      webPageNum: 1,
      webPageSize:2,
			iosTotal: 0,
      iosPageNum: 1,
      iosPageSize:2,
			androidTotal: 0,
      androidPageNum: 1,
      androidPageSize:2,
			deptTotal: 0,
      deptPageNum: 1,
      deptPageSize:5,
			marketTotal: 0,
      marketPageNum: 1,
      marketPageSize:2,
			listLoading: false,
			apiListLoading: false,
			webListLoading: false,
			iosListLoading: false,
			androidListLoading: false,
			publishLoading: false,
			sels: [],//列表选中列5
      listInfo: [],
      market:[],
      clazz:[],
      // checkBox:[{"index":"0","termianl":"Web"},{"index":"2","termianl":"IOS"},{"index":"2","termianl":"Android"},{"index":"3","termianl":"IOS+Android"}],
      activeName: 'first',
      activeTab: 'first',
      checkedSystems1: [],
      // systems: systemOptions,
      editLoading: false,
      toArr:[],
      versionDialogVisible: false,
      editdialogVisible:false,

      appDialogVisible: false,//新增界面是否显示
      apiDialogVisible:false,//api新增弹框
      apiEditDialogVisible:false,//弹框
      webDialogVisible:false,//
      webConfirmDialogVisible:false,//web信息确认弹框
      iosDialogVisible:false,//
      iosConfirmDialogVisible:false,
      androidDialogVisible:false,//
      androidConfirmDialogVisible:false,
      webDetailDialogVisible:false,
      iosDetailDialogVisible:false,
      androidDetailDialogVisible:false,
      choiceVersionDialogVisible:false,//选择终端版本
      publishAppDialogVisible:false,//发布
      publishPositionDialogVisible:false,
      authDeptDialogVisible:false,
      addLoading: false,
      modal16: false,
      deptListLoading:false,
      apiEditModal:[],
      allPublishMarketList:[],

      addFormRules: {
					appCode: [
						{ required: true, message: '请输入应用名称', trigger: 'blur' }
					],
					appName: [
						{ required: true, message: '请输入应用编码', trigger: 'blur' },
            { min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' }
					],
					appMarket: [
						{ required: true, message: '请选择应用市场', trigger: 'blur' },
					],
					appType: [
						{ required: true, message: '请选择应用分类', trigger: 'blur' },
					],
        },
        addForm: {
					appCode:'',
					appName: '',
					appMarket: '',
					appType: ''
        },
        apiForm: {
          appCode:'',
					apiName:'',
					apiAddrss: '',
					gatewayAddrss: ''
        },
        apiTab: {
          appCode:'',
					apiName:'',
					apiAddrss: '',
					gatewayAddrss: ''
        },
        versionTab:{
          appCode:'',
        },
        apiEditForm: {
          appCode:'',
					apiName:'',
					apiAddrss: '',
					gatewayAddrss: ''
        },
        apiFormRules: {
					apiName: [
						{ required: true, message: '请输入API接口名称', trigger: 'blur' }
					],
					gatewayAddrss: [
						{ required: true, message: '请输入网关地址', trigger: 'blur' }
					],
        },
        webForm: {
          appCode:'',
					version:'',
					defaultPackage: 1,
					isRelyOnColud: 0,
					winType: '',
					urlNum: '',
					accessUrl: '',
					versionType: '',
					remark: ''
        },
        webDetailForm: {
          appCode:'',
					version:'',
					defaultPackage: '',
					isRelyOnColud: '',
					winType: '',
					urlNum: '',
					accessUrl: '',
					versionType: '',
					remark: ''
        },
        webFormRules: {
					version: [
						{ required: true, message: '请输入版本号', trigger: 'blur' }
					],
					gatewayAddrss: [
						{ required: true, message: '请输入网关地址', trigger: 'blur' }
					],
        },
        webConfirmForm: {
					appCode:'',
					appName:'',
					appMarket:'',
					appType:'',
					version:'',
					defaultPackage: '',
					winType: '',
					remark: ''
        },
        iosForm: {
					version:'',
					compile: '',
					forceUpdate: '',
					isDefaultInstall: '',
					validateType: '',
					frameType: '',
					forceUpdate: '',
					installPackageUrl: '',
					accessUrl: '',
					startupConfig: '',
					extendConfig: '',
					remark: ''
        },
        iosDetailForm: {
					version:'',
					compile: '',
					forceUpdate: '',
					isDefaultInstall: '',
					validateType: '',
					frameType: '',
					forceUpdate: '',
					installPackageUrl: '',
					accessUrl: '',
					startupConfig: '',
					extendConfig: '',
					remark: ''
        },
        iosFormRules: {
					version: [
						{ required: true, message: '请输入', trigger: 'blur' }
					],
					gatewayAddrss: [
						{ required: true, message: '请输入网关地址', trigger: 'blur' }
					],
        },
        iosConfirmForm: {
					appCode:'',
					appName:'',
					appMarket:'',
					appType:'',
					version:'',
					defaultPackage: '',
					winType: '',
					remark: ''
        },
        androidForm: {
					version:'',
					compile: '',
					forceUpdate: '',
					isDefaultInstall: '',
					validateType: '',
					frameType: '',
					forceUpdate: '',
					installPackageUrl: '',
					accessUrl: '',
					startupConfig: '',
					extendConfig: '',
					remark: ''
        },
        androidDetailForm: {
				version:'',
					compile: '',
					forceUpdate: '',
					isDefaultInstall: '',
					validateType: '',
					frameType: '',
					forceUpdate: '',
					installPackageUrl: '',
					accessUrl: '',
					startupConfig: '',
					extendConfig: '',
					remark: ''
        },
        androidConfirmForm: {
					appCode:'',
					appName:'',
					appMarket:'',
					appType:'',
					version:'',
					defaultPackage: '',
					winType: '',
					remark: ''
        },
        androidFormRules: {
					version: [
						{ required: true, message: '请输入', trigger: 'blur' }
					],
					gatewayAddrss: [
						{ required: true, message: '请输入网关地址', trigger: 'blur' }
					],
        },
        editForm: {
					appCode: '',
					appName: '',
					market: '',
          applicationType: '',
          appSource:'',
          logoImage:'',
          developer:'',
          recommend:'',
          sort:'',
          remark:'',
        },
        editFormRules: {
					appName: [
						{ required: true, message: '请输入应用名称', trigger: 'blur' }
					],
					recommend: [
						{ required: true, message: '请选择是否推荐', trigger: 'blur' }
					],
				},
        extendForm: {
					id: '',
					appCode: '',
					appTerminal: [],
					accessControl: -1,
          appTermianl:[],
          isEnable: '',
          isDefault:'',
          isPreInstall:'',
          attachment:'',
          detailImage:'',
          updateDate:'',
        },
        appTermianl:[],//适用终端 绑定对象
        extendFormRules: {
					appName: [
						{ required: true, message: '请输入应用名称', trigger: 'blur' }
					],
					appMarket: [
						{ required: true, message: '请选择市场', trigger: 'blur' }
          ],
           appTerminal: [
            // { type: 'array', required: true, message: '请至少选择一个', trigger: 'change' }
          ],
					recommend: [
						{ required: true, message: '请选择是否推荐', trigger: 'blur' }
					],
        },
        appPublishFrom:{
          appCode:'',
          appName:'',

        },
        Web:[],
        IOS:[],
        Android:[],
        publishWebInfoFrom:{
          accessUrl:'',
          appBaseInfo:'',
          appCode:'',
          appMarket:'',
          appName:'',
          appType:'',
          compile:'',
          creater:'',
          currentVersion:'',
          defaultPackage:'',
          extendConfig:'',
          forceUpdate:'',
          frameType:'',
          id:'',
          installPackage:'',
          installPackageSize:'',
          installPackageUrl:'',
          isDefaultInstall:'',
          isRelyOnColud:'',
          logoImage:'',
          publish:'',
          remark:'',
          startupConfig:'',
          urlNum:'',
          validateType:'',
          version:'',
          versionType:'',
          winType:''

        },
        publishIOSInfoFrom:{
          accessUrl:'',
          appBaseInfo:'',
          appCode:'',
          appMarket:'',
          appName:'',
          appType:'',
          compile:'',
          creater:'',
          currentVersion:'',
          defaultPackage:'',
          extendConfig:'',
          forceUpdate:'',
          frameType:'',
          id:'',
          installPackage:'',
          installPackageSize:'',
          installPackageUrl:'',
          isDefaultInstall:'',
          isRelyOnColud:'',
          logoImage:'',
          publish:'',
          remark:'',
          startupConfig:'',
          urlNum:'',
          validateType:'',
          version:'',
          versionType:'',
          winType:''

        },
        publishAndroidInfoFrom:{
          // version:'',
          // accessUrl:'',
          // installPackage:'',
          // updateDate:'',
          accessUrl:'',
          appBaseInfo:'',
          appCode:'',
          appMarket:'',
          appName:'',
          appType:'',
          compile:'',
          creater:'',
          currentVersion:'',
          defaultPackage:'',
          extendConfig:'',
          forceUpdate:'',
          frameType:'',
          id:'',
          installPackage:'',
          installPackageSize:'',
          installPackageUrl:'',
          isDefaultInstall:'',
          isRelyOnColud:'',
          logoImage:'',
          publish:'',
          remark:'',
          startupConfig:'',
          urlNum:'',
          validateType:'',
          version:'',
          versionType:'',
          winType:''

        },
        addPublishMarketForm:{
         marketCode:'',
         applictionType:''
        },
        addPublishMarketFormRules:{
          marketCode: [
						{ required: true, message: '请输入应用市场', trigger: 'blur' }
					],
					applictionType: [
						{ required: true, message: '请选择应用分类', trigger: 'blur' }
					],
        },
         defaultProps: {
          // children: 'children',
          label: 'marketName',
          isLeaf: 'leaf',
        },
        fileList: [],
        paramData:{sys:1,module:1,keyId:"12312312312"},// todo 文件上传附加参数，必须先定义，而且后续修改必须用：属性引用修改：this.paramData.keyId="9999999999999999999999";
        fileList_Unlimited: [],
        fileListData:{sys:1,module:1,keyId:"12312312312"},// todo 文件上传附加参数，必须先定义，而且后续修改必须用：属性引用修改：this.paramData.keyId="9999999999999999999999";
        picList: [],
        picListData:{sys:1,module:1,keyId:"12312312312"},// todo 文件上传附加参数，必须先定义，而且后续修改必须用：属性引用修改：this.paramData.keyId="9999999999999999999999";
        iosApkList: [],
        iosListData:{sys:1,module:1,keyId:"12312312312"},// todo 文件上传附加参数，必须先定义，而且后续修改必须用：属性引用修改：this.paramData.keyId="9999999999999999999999";
        androidApkList: [],
        androidListData:{sys:1,module:1,keyId:"12312312312"},// todo 文件上传附加参数，必须先定义，而且后续修改必须用：属性引用修改：this.paramData.keyId="9999999999999999999999";
        authorizedialogVisible:false,


        formLabelWidth: '120px',

        apiData:[],

        uploadUrl:''
    };
  },
  methods: {
    toAuthorize(index,row){
      this.authorizedialogVisible = true;
      this.rowAppObj = Object.assign({}, row);
      this.deptList(this.rowAppObj);
      // vm.$emit('blur','sichaoyun'); //触发事件
    },
    toAuthDept(index,row){
      this.authDeptDialogVisible = true;
      this.rowAppObj = Object.assign({}, row);
      // vm.$emit('blur','sichaoyun'); //触发事件
    },
    submitUpload() {
        this.paramData.keyId="9999999999999999999999";
        this.$refs.upload.submit();
    },submitUpload_LOGO() {
        this.paramData.keyId="9999999999999999999999";
        this.$refs.upload_LOGO.submit();
    },
    submitFile() {
        this.fileListData.keyId="9999999999999999999999";
        this.$refs.fileUplod.submit();
    },
    submitPic_4() {
        this.picListData.keyId="9999999999999999999999";
        this.$refs.picUplod.submit();
    },
    submitIOS_apk() {
        this.iosListData.keyId="9999999999999999999999";
        this.$refs.iosUplod.submit();
    },
    submitAndroid_apk() {
        this.androidListData.keyId="9999999999999999999999";
        this.$refs.androidUplod.submit();
    },
    handleRemove(file, fileList) {
        console.log("移除文件");
        console.log(file, fileList);
    },
    beforeRemove(file, fileList) {
        return this.$confirm(`确定移除 ${ file.name }？`);
    },
    handlePreview(file) {
        console.log("点击文件");
        console.log(file);
    },
    handleExceed(files, fileList) {
        this.$message.warning(`当前限制选择 1 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
    },
    beforeRemove(file, fileList) {
        return this.$confirm(`确定移除 ${ file.name }？`);
    },
    uploadSuccess(response, file, fileList){//应用logo
      this.extendForm.logoImage = response.data.fileUri
      this.editForm.logoImage = response.data.fileUri;
        console.log(response.data.fileUri)
    },uploadSuccess_LOGO(response, file, fileList){//应用logo
      this.extendForm.logoImage = response.data.fileUri
      this.editForm.logoImage = response.data.fileUri;
        console.log(response.data.fileUri)
    },
    fileuploadSuccess(response, file, fileList){//上传附件
      this.extendForm.attachment = response.data.fileUri
        console.log(response.data.fileUri)
    },
    picUploadSuccess(response, file, fileList){//上传应用截图
      this.extendForm.detailImage = response.data.fileUri
        console.log(response.data.fileUri)
    },
    iosUploadSuccess(response, file, fileList){//上传Ios   apk
      this.iosForm.installPackageUrl = response.data.fileUri;//安装包路径
      this.iosForm.installPackageSize = response.data.fileSize;//安装包大小
        console.log(response.data.fileUri)
    },
    andoridUploadSuccess(response, file, fileList){//上传Android  apk
       this.androidForm.installPackageUrl = response.data.fileUri;//安装包路径
      this.androidForm.installPackageSize = response.data.fileSize;//安装包大小
        console.log(response.data.fileUri)
    },
    changeCheckBox4AppTermianl(val){
          this.extendForm.appTermianl=this.appTermianl;
          console.log(this.extendForm)
      },
    loadData(node,resolve){
      let rootName = '市场';
      if(node.level ===0){
        resolve([{marketName:rootName}]);
         return;
      }

      if(node.data.marketName===rootName){
        let params ={
          marketName:'',
        }
        getMarketList(params).
        then(res => {
          console.log(res.data.list);
          res.data.list.map(item=>{item.leaf=true;});
          resolve(res.data.list);
        }).catch(function (error) {
            this.$message.warning('系统异常 ');
        });
        return;
      }
      return ;
    },
    toGetList:function(){
      this.getList();
    },
    formatIsSynchro: function (row, column) {
				return row.isSynchro == 1 ? '是' : row.isSynchro == 0 ? '否' : '未知';
			},
			formatIsEnable: function (row, column) {
				return row.isEnable == 1 ? '是' : row.isEnable == 0 ? '否' : '未知';
			},
			formatCurrentVersion: function (row, column) {
				return row.currentVersion == 1 ? '是' : row.currentVersion == 0 ? '否' : '';
			},
			formatVersion: function (row, column) {
				return row.versionType == 1 ? 'Web' : row.versionType == 2 ? 'IOS' : row.versionType == 3 ? 'Android':'';
      },
      //时间格式化
			formatCreateDate: function (row, column) {
				return row.createDate = (!row.createDate || row.createDate == '') ? '' : util.formatDate.format(new Date(row.createDate), 'yyyy-MM-dd hh:mm:ss');
			},
			formatUpdateDate: function (row, column) {
				return row.updateDate = (!row.updateDate || row.updateDate == '') ? '' : util.formatDate.format(new Date(row.updateDate), 'yyyy-MM-dd hh:mm:ss');
			},
    handleClose(done) {
            this.$confirm('确认关闭？')
            .then(_ => {
                done();
            })
            .catch(_ => {});
        },
        handleClick(tab, event) {
            console.log(tab, event);
        },
        asyncOK () {
            this.modal6 = false;
        },
    handleCurrentPageChange: function (pageNum) {// 翻页动作
        this.pageNum = pageNum;
        this.getList();// 翻页后刷新页面数据
    },
    handleCurrentAPiPageChange: function (apiPageNum) {// 翻页动作
        this.apiPageNum = apiPageNum;
        this.apiList();// 翻页后刷新页面数据
    },
    handleCurrentWebPageChange: function (webPageNum) {// 翻页动作
        this.webPageNum = webPageNum;
        this.webList();// 翻页后刷新页面数据
    },
    handleCurrentIosPageChange: function (iosPageNum) {// 翻页动作
        this.iosPageNum = iosPageNum;
        this.iosList();// 翻页后刷新页面数据
    },
    handleCurrentAndroidPageChange: function (androidPageNum) {// 翻页动作
        this.androidPageNum = androidPageNum;
        this.androidList();// 翻页后刷新页面数据
    },
    handleCurrentMarketPageChange: function (marketPageNum) {// 翻页动作
        this.marketPageNum = marketPageNum;
        this.appMarketList();// 翻页后刷新页面数据
    },
    handleSwitch(lang) {
      this.lang = lang;
      localStorage.lang = lang;
      this.$store.commit("switchLang", lang); // 如果你要自己实现多语言切换，那么只需要执行这行代码即可，修改语言类型

      this.columnsI18n = [
        {
          key: "name",
          title: this.$t("name")
        },
        {
          key: "company",
          title: this.$t("company")
        }
      ]; // 像iview的table组件这样一次渲染如果数据不更新视图就不更新的组件，如果切换语言需要更新一下数据才能切换组件内的多语言
    },
        //显示完善资料界面
    appEdit: function (index, row) {
      var _this = this;
      this.editdialogVisible = true;
      this.editForm = Object.assign({}, row);
      let toArr = [];
      if(row.extendMap.appTerminal != null){
        toArr = row.extendMap.appTerminal.split(",");
      }
      row.extendMap.appTerminal = toArr;
      this.extendForm = Object.assign({}, row.extendMap);
      this.appTermianl = toArr;
      this.apiTab.appCode = row.appCode;
      this.apiList();//加载api 列表
      //加载供应商数据
      let params = {
					pageNum: 1,
          pageSize:10000
      }
      getSupplierList(params).then(function(result){
          this.supplierData = result.data.list;
				}.bind(this)).catch(function (error) {
				}.bind(this));
    },

    toPublishApp: function (index, row) {
      this.choiceVersionDialogVisible = true;
      this.appPublishFrom = Object.assign({}, row);
      // 储存当前记录的appCode值（暂时解决版本乱套的问题）
      this.versionTab.appCode = this.appPublishFrom.appCode;
      // console.log(row);
      this.publish_webList();
      this.publish_iosList();
      this.publish_androidList();
      this.appMarketList();
    },
    //编辑api
    tabEdit: function (index, row) {
      let params = {};
      searchApimanageService(params).then(function(result){
          this.apiData = result.data.data.data;
          this.apiEditForm = Object.assign({}, row);
          this.modal16 = true;
      }.bind(this)).catch(function (error) {
			}.bind(this));
    },
    versionEdit: function (index, row) {//版本信息弹框
      this.versionDialogVisible = true;
      this.versionTab = Object.assign({}, row);
      this.versionTab.appCode= row.appCode;
      this.webList();
      this.iosList();
      this.androidList();
    },
    appAdd:function(){
				this.addForm = {
					appCode: '',
					appName: '',
					appMarket: '',
					appType: ''

				};
        this.marketlist();
        this.classlist();
        this.appDialogVisible = true;

      },
    apiAdd:function(){
        let params = {}
        searchApimanageService(params).then(function(result){
          this.apiData = result.data.data.data;
          this.apiDialogVisible = true;
          this.apiForm = {
          appCode:'',
					apiName: '',
					apiAddrss: '',
					gatewayAddrss: ''
				};
				}.bind(this)).catch(function (error) {
				}.bind(this));
      },
      apiSelectChange:function(value,form){
        let _this = this;
        this.apiData.forEach(obj => {
          if(obj.name === value){
            if(form === 'apiAdd'){
              _this.apiForm.apiAddrss = obj.publicPath;
              _this.apiForm.gatewayAddrss = obj.serviceAddress
            }
            if(form === "apiEdit"){
              _this.apiEditForm.apiAddrss = obj.publicPath;
              _this.apiEditForm.gatewayAddrss = obj.serviceAddress
            }
            return
          }
        });
      },
    webAdd:function(){
        this.webDialogVisible = true;
				this.webForm = {
					version: '',
					defaultPackage: '',
					winType: '',
					isRelyOnColud: '',
					accessUrl: '',
					urlNum: '',
					remark: '',

				};

      },
    webConfirm:function(){
      if(this.webForm.version == ""){
        return;
      }
      let params = Object.assign({}, this.webForm);
        params.appCode  = this.versionTab.appCode;
        params.versionType = "1";
        createVersion(params).then((res) => {
              //NProgress.done();
              this.webConfirmForm = {
              id:'',
              appCode: '',
					    appName: '',
					    appMarket: '',
					    appType: '',
					    logoImage: '',
					    attachment: '',
					    remark: '',
					    version: '',
					    winType: '',
					    accessUrl: ''
        };
        this.submitWeb(params);
			});
      },
      submitWeb(_params){
        let _this = this;
          let params ={
           appCode:_params.appCode,
           versionType:_params.versionType,
           version:_params.version
        }
        versionList(params).then(function(result){
          if(result.data.list.length > 0){
              let re = result.data.list[0];
              _this.webConfirmForm = re;
          }
        })
        this.webConfirmDialogVisible = true;
      },
    iosAdd:function(){
        this.iosDialogVisible = true;
				this.iosForm = {
					version: '',
					compile: '',
					forceUpdate: '',
					isDefaultInstall: '',
					validateType: '',
					frameType: '',
					installPackageUrl: '',
					installPackage: '',
					installPackageSize: '',
					accessUrl: '',
					startupConfig: '',
					extendConfig: '',
					remark: ''

				};

      },
      addPublishMarket:function(){//添加发布 市场
        this.marketlist();
        this.classlist();
        this.publishPositionDialogVisible = true;
      },
    iosConfirm:function(){
      let params = Object.assign({}, this.iosForm);
        params.appCode  = this.versionTab.appCode;
        params.versionType = "2";
        createVersion(params).then((res) => {
            //NProgress.done();
            this.iosConfirmForm = {
            id:'',
            appCode: '',
            appName: '',
            appMarket: '',
            appType: '',
            logoImage: '',
            attachment: '',
            remark: '',
            attachment: '',
            version: '',
            installPackageUrl: '',
            installPackage: '',
            accessUrl: ''
        };
        this.submitIOS(params);
			});
      },
       submitIOS(_params){
        let _this = this;
          let params ={
           appCode:_params.appCode,
           versionType:_params.versionType,
           version:_params.version
        }
        versionList(params).then(function(result){
          if(result.data.list.length > 0){
              let re = result.data.list[0];
              _this.iosConfirmForm = re;
          }
        })
        this.iosConfirmDialogVisible = true;
      },
    androidAdd:function(){
        this.androidDialogVisible = true;
				this.androidForm = {
					version: '',
					compile: '',
					forceUpdate: '',
					isDefaultInstall: '',
					validateType: '',
					frameType: '',
					installPackageUrl: '',
					installPackage: '',
					installPackageSize: '',
					accessUrl: '',
					startupConfig: '',
					extendConfig: '',
					remark: ''

				};

      },
    androidConfirm:function(){
       let params = Object.assign({}, this.androidForm);
        params.appCode  = this.versionTab.appCode;
        params.versionType = "3";
        createVersion(params).then((res) => {
            //NProgress.done();
           this.androidConfirmForm = {
              id:'',
              appCode: '',
              appName: '',
              logoImage: '',
              appMarket: '',
              appType: '',
              remark: '',
              attachment: '',
              version: '',
              installPackageUrl: '',
              installPackage: '',
              accessUrl: ''

				};
        this.submitAndroid(params);
			});
      },
      submitAndroid(_params){
        let _this = this;
          let params ={
           appCode:_params.appCode,
           versionType:_params.versionType,
           version:_params.version
        }
        versionList(params).then(function(result){
          if(result.data.list.length > 0){
              let re = result.data.list[0];
              _this.androidConfirmForm = re;
          }
        })
        this.androidConfirmDialogVisible = true;
      },
       //实现回车键搜索功能
			searchEnterFun:function(e){
				this.getList();
            },
			getList() {
				let params = {
					pageNum: this.pageNum,
          pageSize:this.pageSize,
					appCode: this.filters.appCode,
          appName: this.filters.appName,
          marketName:this.filters.marketName,
          marketNameList:this.$refs.tree.getCheckedKeys(),
        };
        console.log(params);
				this.listLoading = true;
				//NProgress.start();
				getAppList(params).then(function(result){
          this.tableData = result.data.list;
          this.pageNum = result.data.pageNum;
          this.pageSize = result.data.pageSize;
					this.total = result.data.total;
					this.listLoading = false;
				}.bind(this)).catch(function (error) {
					this.listLoading = false;
					console.log(error);
				}.bind(this));
      },
      	appMarketList() {//发布市场列表 选择页
				let params = {
					pageNum: this.marketPageNum,
          pageSize:this.marketPageSize,
					appCode: this.appPublishFrom.appCode,
				};
				publishMarket(params).then(function(result){
          this.publishMarketList = result.data.list;
          this.marketPageNum = result.data.pageNum;
          this.marketPageSize = result.data.pageSize;
					this.marketTotal = result.data.total;
				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
      },
      	topublishMarketList() {//发布市场列表 确认页
				let params = {
					appCode: this.appPublishFrom.appCode,
				};
				getAllPublishMarket(params).then(function(result){
          this.allPublishMarketList = result.data;
				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
      },
      //获取api列表
			apiList() {
				let params = {
					pageNum: this.apiPageNum,
          pageSize:this.apiPageSize,
           appCode:this.apiTab.appCode

        };
        this.apiListLoading = true;
				getApiList(params).then(function(result){
          this.apiTableList = result.data.list;
          this.apiPageNum = result.data.pageNum;
          this.apiPageSize = result.data.pageSize;
					this.apiTotal = result.data.total;
					this.apiListLoading = false;
				}.bind(this)).catch(function (error) {
					this.apiListLoading = false;
					console.log(error);
				}.bind(this));
      },
      apiEditSubmit: function () {
				this.$refs.apiEditForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交吗？', '提示', {}).then(() => {
							this.editLoading = true;
							//NProgress.start();
              let params = Object.assign({}, this.apiEditForm);
              if(params.updateDate != ''){
								params.updateDate = Date.parse(new Date(params.updateDate));
							}
							editApi(params).then((res) => {
								this.editLoading = false;
								this.$message({
									message: '提交成功',
									type: 'success'
								});
								this.$refs['apiEditForm'].resetFields();
								this.modal16 = false;
								this.apiList();
							});
						});
					}
				});
      },
      toPublish: function (para) {//发布版本
						this.$confirm('确认发布吗？', '提示', {}).then(() => {
							this.publishLoading = true;
              //NProgress.start();
              let form;
              if(para==1){
                form = Object.assign({}, this.webConfirmForm);
              }else if(para == 2){
                form = Object.assign({}, this.iosConfirmForm);
              }else{
                form = Object.assign({}, this.androidConfirmForm);

              }
              let params = {
                publish:1,
                id:form.id,
                appCode:form.appCode,
                versionType:form.versionType
              }
              console.log(params)
							updateVersion(params).then((res) => {
								this.publishLoading = false;
								this.$message({
									message: '发布成功',
									type: 'success'
								});
                if(para==1){
								this.webConfirmDialogVisible = false;
                this.webForm = false;
                this.webList();
                }else if(para == 2){
                  this.iosConfirmDialogVisible = false;
                  this.iosList();
                }else{
                  this.androidConfirmDialogVisible = false;
                  this.androidList();
                }
							});
						});
      },
      doPublish: function () {//发布应用
              let data1 = Object.assign({},this.appPublishFrom);
              let data2 = Object.assign({},this.publishWebInfoFrom);
              let data3 = Object.assign({},this.publishIOSInfoFrom);
              let data4 = Object.assign({},this.publishAndroidInfoFrom);
              let data5 = this.allPublishMarketList;//确认发布 市场  list
              let params = {
                app:data1,
                marketList:data5
              }
              if(data2.id !=''){
                params['ver1'] = data2;
              }
              if(data3.id!=''){
                params['ver2'] = data3;
              }
              if(data4.id!=''){
                params['ver3'] = data4;
              }
              console.log(params);
						this.$confirm('确认发布吗？', '提示', {}).then(() => {
							sendObj(params).then((res) => {
								this.$message({
									message: '发布成功',
									type: 'success'
								});
                this.choiceVersionDialogVisible = false;
                this.publishAppDialogVisible= false;
                this.getList();
							});
						});
      },
      putDown(index, row){
        //直接下架
        let _this = this;
        let type ;
        let typeInt
        if(row.versionType==1){
          type=' Web ',
          typeInt =1
        }else if(row.versionType==2){
          type=' IOS ',
          typeInt =2
        }else{
          type=' Android ',
          typeInt =3
        }
        this.$confirm('确认下架'+ type +row.version+' 当前版本？', '提示', {}).then(() => {
          if(typeInt ==1){
              this.webListLoading = true;
          }
         let data = Object.assign({},row);
          let params ={
            id:data.id,
            currentVersion:0,
          }
          updateVersion(params).then((res) => {
            if(typeInt ==1){
              this.webListLoading = false;
            }
             this.$message({
               message: '下架成功',
               type: 'success'
             });
              if(typeInt==1){
                 _this.webList();
              }else if(typeInt==2){
                _this.iosList();
              }else{
                _this.androidList();
              }
           });
        });
      },
      check(index,row){
        //查询当前应用是否已有版本上架
        let data = Object.assign({},row);
        let params ={
          appCode:data.appCode,
          versionType:data.versionType,
          currentVersion:1,
        }
        versionList(params).then((res) =>{
          let size = res.data.list.length;
          if(size==0){
            this.isPublishVersion(index,row)
          }else{
             this.$alert('请先下架当前版本'),{
                confirmButtonText: '确定',
             }
          }
        });
      },
      isPublishVersion(index,row){//版本是否已发布
        let data = Object.assign({},row);
        if(data.publish==1){
          this.putUP(index,row);
        }else{
           this.$alert('该版本未发布'),{
                confirmButtonText: '确定',
           }
        }
      },
      putUP(index, row){//设为当前版本
        let _this = this;
          let type ;
          if(row.versionType==1){
            type=' Web '
          }else if(row.versionType==2){
            type=' IOS '
          }else{
            type=' Android '
          }
          this.$confirm('确认是否将 '+ type +row.version+' 版本设置为当前版本？', '提示', {}).then(() => {
            let data = Object.assign({},row);
            let params ={
              id:data.id,
              currentVersion:1,
            }
            updateVersion(params).then((res) => {
              this.webListLoading = false;
              this.$message({
                message: '成功',
                type: 'success'
              });
              if(row.versionType==1){
                 _this.webList();
              }else if(row.versionType==2){
                _this.iosList();
              }else{
                _this.androidList();
              }
            });
          });
      },
      marketlist(){  //应用市场 下拉框值
        let params = {marketName:''};
        getMarketList(params).then(function(result){
          this.market = result.data.list;
        }.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));

      },
      classlist(){  //应用分类 下拉框值
        let params = {className:''};
        getApplicationTypeList(params).then(function(result){
          this.clazz = result.data.list;
        }.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));

      },
        publish_webList() {//获取有效web版本
        if(this.versionTab.appCode === ""){
          return;
        }
				let params = {
          version:'',
					appCode:this.versionTab.appCode,
          currentVersion:1,
          versionType:1
        };
        console.log(this.Web+">>>>>>>>>");
				versionList(params).then(function(result){
          this.Web = result.data.list;
				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
      },
      	publish_iosList() {
				let params = {
          version:'',
					appCode:this.versionTab.appCode,
          currentVersion:1,
          versionType:2
				};
				versionList(params).then(function(result){
          this.IOS = result.data.list;
				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
      },
      	publish_androidList() {//android 版本下拉框
				let params = {
          version:'',
					appCode:this.versionTab.appCode,
          currentVersion:1,
          versionType:3
				};
				versionList(params).then(function(result){
          this.Android = result.data.list;
				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
      },
      linkVersion:function(ele){//查询版本关联信息
        let params ={id:ele}
        versionList(params).then(function(result){
          let type = result.data.list[0].versionType;
          let data = result.data.list[0];

          if(type==1){
            this.publishWebInfoFrom = Object.assign({}, data);
          }else if(type==2 ){
            this.publishIOSInfoFrom = Object.assign({}, data);
          }else{
          this.publishAndroidInfoFrom = Object.assign({}, data);
          }
				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));

      },
      	webList() {//加载Web 列表
				let params = {
					pageNum: this.webPageNum,
          pageSize:this.webPageSize,
					appCode:this.versionTab.appCode,
          version: this.filters2.version,
          versionType:1
				};
				this.webListLoading = true;
        //NProgress.start();
				versionList(params).then(function(result){
          this.webTableList = result.data.list;
          this.webPageNum = result.data.pageNum;
          this.webPageSize = result.data.pageSize;
					this.webTotal = result.data.total;
					this.webListLoading = false;
				}.bind(this)).catch(function (error) {
					this.webListLoading = false;
					console.log(error);
				}.bind(this));
      },
      	iosList() {
				let params = {
					pageNum: this.iosPageNum,
          pageSize:this.iosPageSize,
					appCode:this.versionTab.appCode,
          version: this.filters3.version,
          versionType:2
				};
				this.iosListLoading = true;
        //NProgress.start();
				versionList(params).then(function(result){
          this.iosTableList = result.data.list;
          this.iosPageNum = result.data.pageNum;
          this.iosPageSize = result.data.pageSize;
					this.iosTotal = result.data.total;
					this.iosListLoading = false;
				}.bind(this)).catch(function (error) {
					this.iosListLoading = false;
					console.log(error);
				}.bind(this));
      },
      	androidList() {
				let params = {
					pageNum: this.androidPageNum,
          pageSize:this.androidPageSize,
					appCode:this.versionTab.appCode,
          version: this.filters4.version,
          versionType:3
				};
				this.androidListLoading = true;
        //NProgress.start();
				versionList(params).then(function(result){
          this.androidTableList = result.data.list;
          this.androidPageNum = result.data.pageNum;
          this.androidPageSize = result.data.pageSize;
					this.androidTotal = result.data.total;
					this.androidListLoading = false;
				}.bind(this)).catch(function (error) {
					this.androidListLoading = false;
					console.log(error);
				}.bind(this));
      },
      publishConfirm:function(){//应用发布-》确认页面提交操作
      //保存初始发布
       let v1 = Object.assign({}, this.publishWebInfoFrom);
       let v2 = Object.assign({}, this.publishIOSInfoFrom);
       let v3 = Object.assign({}, this.publishAndroidInfoFrom);
       let vid1 = v1.id;
       let vid2 = v2.id;
       let vid3 = v3.id;
       if(vid1=='' && vid2 ==''&& vid3==''){
         this.$message({
									message: '请至少选择一个终端类型版本',
									type: 'success'
                });
                return;
       }
       if(v1.id !=0){//将该版本设置为初始发布版本
         	let params = {
					id: v1.id,
          isUseful:1,
				}
           console.log(params);
         updateVersion(params).then(function(result){
				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
       }
       if(v2.id !=0){
         	let params = {
					id: v2.id,
          isUseful:1,
				}
           console.log(params);
         updateVersion(params).then(function(result){

				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
       }
       if(v3.id !=0){
         	let params = {
					id: v3.id,
          isUseful:1,
				}
           console.log(params);
         updateVersion(params).then(function(result){

				}.bind(this)).catch(function (error) {
					console.log(error);
				}.bind(this));
       }
       this.topublishMarketList();

        this.publishAppDialogVisible= true;
      },
      addSubmit: function () {
				this.$refs.addForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交吗？', '提示', {}).then(() => {
							this.addLoading = true;
							//NProgress.start();
              let params = Object.assign({}, this.addForm);
							addApp(params).then((res) => {
								this.addLoading = false;
								//NProgress.done();
								this.$message({
									message: '提交成功',
									type: 'success'
								});
								this.$refs['addForm'].resetFields();
								this.appDialogVisible = false;
								this.getList();
							});
						});
					}
				});
      },
      deptList(obj){
            let params = {
                pageNum: this.deptPageNum,
                pageSize:this.deptPageSize,
              appCode:obj.appCode,
            }
            doAuthDept(params).then(function(result){
                let _this = this;
                // this.deptTableData.push('isAuth')
                // this.deptTableData = result.data.data.list;
                this.deptPageNum = result.data.data.pageNum;
                this.deptPageSize = result.data.data.pageSize;
                this.deptTotal = result.data.data.total;
                // this.deptListLoading = false;
                // this.deptTableData = result.data.data.list.map(function(x,y,z){
                //      let params= {
                //          appCode:obj.appCode,
                //          dept:x.orgSerialNo
                //    }
                  //  getAuth(params).then(function(res){
                  //      console.log("-----------------------------------------------")
                  //      console.log(params)
                  //      debugger
                  //       if(res.data.length==1){//已授权
                  //      console.log("----------------------true-------------------------")
                  //           z[y].aa = true;
                  //           // return true;
                  //       }else if(res.data.length==0){//未授权
                  //      console.log("------------------------false-----------------------")
                  //           z[y].aa = false;
                  //       }else{//
                  //       console.log("--------------------------系统异常-----------------------")
                  //           // this.$message.warning('系统异常 ');
                  //       }
                  //   }.bind(this)).catch(function (error) {
                  //           console.log(error);
                  //   })

                // });
                _this.deptTableData = result.data.data.list;
                // console.log("..............................jj")
                // console.log(result.data.data);
                // console.log(_this.deptTableData);
                // console.log("..............................jj")
            }.bind(this)).catch(function (error) {
                this.deptListLoading = false;
                console.log(error);
            }.bind(this));
        },
      // getDeptList:function(){
      //   let _this =  this;
      //   let params = {
      //       pageNum:_this.deptPageNum,
      //       pageSize:_this.deptPageSize,
      //   }
      //   deptList(params).then(function(result){
      //       _this.deptData = result.data.data.list,
      //       // _this.deptData = Object.assign([],_this.deptData,result.data.data.list),
      //       _this.deptPageNum = result.data.data.pageNum,
      //       _this.deptPageSize = result.data.data.pageSize,
      //       _this.deptTotal = result.data.data.total
      //   });
      // },
      Click(row){
        let _this = this;
        // console.log("row。。。。。。。。。。。。。。。。。。。")
        console.log(row)
        if(row.isAuth){
          //to do 取消授权
           this.$confirm('确认取消授权吗？', '提示', {}).then(() => {
             delAuth(row).then(function(res){
                _this.deptListLoading = false;
                _this.$message({
                  message: '成功',
                  type: 'success'
               });
               _this.deptList(_this.rowAppObj);
             });
           });
        }else{
          // 授权
          this.$confirm('确认授权吗？', '提示', {}).then(() => {
            addAuth(row).then(function(res){
              _this.deptListLoading = false;
              _this.$message({
              	message: '成功',
              	type: 'success'
              });
               _this.deptList(_this.rowAppObj);
            });
          });
        }
    },
      toAddPublishMarket:function(){//添加发布市场
        this.$refs.addPublishMarketForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认添加吗？', '提示', {}).then(() => {
							//NProgress.start();
              let params = Object.assign({}, this.addPublishMarketForm);
              params.appCode = this.appPublishFrom.appCode;
              console.log(params)
							addPublishMarket(params).then((res) => {
								//NProgress.done();
								this.$message({
									message: '添加成功',
									type: 'success'
								});
								this.$refs['addPublishMarketForm'].resetFields();
								this.publishPositionDialogVisible = false;
								this.appMarketList();
							});
						});
					}
				});
    },
      view:function(index, row){
        if(row.versionType==1){
          this.webDetailDialogVisible = true ;
          this.webDetailForm = Object.assign({}, row);
          if(row.winType==0){//窗口类型回显
            this.webDetailForm.winType ='最大化';
          }else if(row.winType==1){
            this.webDetailForm.winType ='横向布局';
          }else{
            this.webDetailForm.winType ='纵向布局';

          }
        }else if(row.versionType==2){
          this.iosDetailDialogVisible = true ;
          this.iosDetailForm = Object.assign({}, row);
          if(row.validateType==0){
            this.iosDetailForm.validateType='单点登录验证';
          }else{
            this.iosDetailForm.validateType='不验证';
          }
          if(row.frameType==0){
            this.iosDetailForm.frameType='原生开发';
          }else if(row.frameType==1){
            this.iosDetailForm.frameType='BingoTouch';
            }else{
            this.iosDetailForm.frameType='标准WEB程序';
          }
        }else{
          this.androidDetailDialogVisible = true ;
          this.androidDetailForm = Object.assign({}, row);
           if(row.validateType==0){
            this.androidDetailForm.validateType='单点登录验证';
          }else{
            this.androidDetailForm.validateType='不验证';
          }
          if(row.frameType==0){
            this.androidDetailForm.frameType='原生开发';
          }else if(row.frameType==1){
            this.androidDetailForm.frameType='BingoTouch';
            }else{
            this.androidDetailForm.frameType='标准WEB程序';
          }
        }
      },
      saveApi: function () {
				this.$refs.apiForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交吗？', '提示', {}).then(() => {
							this.addLoading = true;
							//NProgress.start();
              let params = Object.assign({}, this.apiForm);
              params.appCode  = this.extendForm.appCode;
							createApi(params).then((res) => {
								this.addLoading = false;
								this.$message({
									message: '提交成功',
									type: 'success'
								});
								this.$refs['apiForm'].resetFields();
								this.apiDialogVisible = false;
								this.apiList();
							});
						});
					}
				});
      },
      saveWeb: function () {
				this.$refs.webForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交吗？', '提示', {}).then(() => {
							this.addLoading = true;
              let params = Object.assign({}, this.webForm);
              params.appCode  = this.versionTab.appCode;
              params.versionType = "1";
							createVersion(params).then((res) => {
								this.addLoading = false;
								this.$message({
									message: '提交成功',
									type: 'success'
								});
								this.$refs['webForm'].resetFields();
                this.webDialogVisible = false;
                this.webList();
							});
						});
					}
				});
      },
      saveIOS: function () {
				this.$refs.iosForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交吗？', '提示', {}).then(() => {
							this.addLoading = true;
              let params = Object.assign({}, this.iosForm);
              params.appCode  = this.versionTab.appCode;
              params.versionType = "2";
							createVersion(params).then((res) => {
								this.addLoading = false;
								this.$message({
									message: '提交成功',
									type: 'success'
								});
								this.$refs['iosForm'].resetFields();
                this.iosDialogVisible = false;
                this.iosList();
							});
						});
					}
				});
      },
      saveAndroid: function () {
				this.$refs.androidForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交吗？', '提示', {}).then(() => {
							this.addLoading = true;
							//NProgress.start();
              let params = Object.assign({}, this.androidForm);
              params.appCode  = this.versionTab.appCode;
              params.versionType = "3";
							createVersion(params).then((res) => {
								this.addLoading = false;
								//NProgress.done();
								this.$message({
									message: '提交成功',
									type: 'success'
								});
								this.$refs['androidForm'].resetFields();
                this.androidDialogVisible = false;
                this.androidList();
							});
						});
					}
				});
      },
      editSubmit: function () {// 完善资料  确认 提交
      var _this = this
				this.$refs.editForm.validate((valid) => {
					if (valid) {
						this.$confirm('确认提交吗？', '提示', {}).then(() => {
							this.editLoading = true;
              //NProgress.start();
              let params = Object.assign({}, this.editForm);
              // let tst = "Android,IOS";
              // console.log(params)
              params.extendMap = Object.assign({}, this.extendForm);
              let arr = new Array();
              arr= _this.appTermianl;
              if(arr[0] === ""){
                delete(arr[0]);
              }
              let toStr = "";
              arr.forEach(obj => {
                toStr += obj + ",";
              });
              if(toStr.length>0){
                toStr = toStr.substring(0,toStr.length-1);
              }
              params.createDate = Date.parse(new Date(params.createDate));
              params.updateDate = Date.parse(new Date(params.updateDate));
              params.extendMap.updateDate = Date.parse(new Date(params.extendMap.updateDate));
              params.extendMap.appTerminal = toStr;
              params.extendMap.appCode = params.appCode;
							editApp(params).then((res) => {
								this.editLoading = false;
								this.$message({
									message: '提交成功',
									type: 'success'
								});
								this.$refs['editForm'].resetFields();
								this.editdialogVisible = false;
								this.getList();
							});
						});
					}
				});
      },
      apiDelete: function (index, row) {
				this.$confirm('确认删除该记录吗?', '提示', {
					type: 'warning'
				}).then(() => {
					this.listLoading = true;
					//NProgress.start();
          let params = {id:row.id};
					deleteApi(params).then((res) => {
						this.listLoading = false;
						//NProgress.done();
						this.$message({
							message: '删除成功',
							type: 'success'
						});
						this.apiList();
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
      },
      marketDelete: function (index, row) {
        let params ={
          appCode:this.appPublishFrom.appCode,
          marketCode:row.marketCode,
          applictionType:row.clazz.classCode
        }
        console.log(params);
        getpublishMarketList(params).then((res) =>{

				this.$confirm('确认删除该记录吗?', '提示', {
          type: 'warning'
				}).then(() => {
          let params = {id:res.data.list[0].id};
          console.log(res)
					removeMarket(params).then((res) => {
            console.log(params)
						this.$message({
							message: '删除成功',
							type: 'success'
						});
						this.appMarketList();
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
        });
        console.log(row)
			},
     handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },
      // 如果新增web的时候没有发布版本 在这里发布
      publishVersion: function(index,row) {
        let params = {
            appCode:row.appCode,
            versionType:row.versionType,
            version:row.version
        }
        this.submitWeb(params);
      }
  },
  computed: {
    placeholderText() {
      return this.$t("placeholderText");
    },
    placeholderDate() {
      return this.$t("placeholderDate");
    }
  },
  created() {
    this.lang = localStorage.lang || "zh-CN";
  },
  mounted(){
    this.getList();
    // this.toAuthorize();
    this.uploadUrl = utils.uploadUrl(); //设置图片上传地址
  }
};
</script>
</<style>
  /* .el-button--text {
    color: #409EFF;
    background: 0 0;
    padding-left: 0;
    padding-right: 0;
  } */
</style>
